Redirect from HTTP To HTTPS In CPanel

Many of you might be facing this problem, while working on your website. You website is all set and ready to go live, but is still using HTTP instead of HTTPS, in such a case you can re-direct your website from HTTP to HTTPS.

Difference Between HTTP And HTTPS

HTTP is Hyper Text Transfer Protocol, where as HTTPS is Hyper Text Transfer Protocol Secure which is an extension of HTTP. These transfer protocols are nothing but a set of rules which applies to the communication over internet. In other words, communication between client computers and web servers is done by sending HTTP/HTTPS requests and receiving HTTP/HTTPS responses.

Why Is Redirecting From HTTP To HTTPS Required?

Redirecting from HTTP to HTTPS is required to make sure that communication via the internet is secure. If you have a very basic website, which has a few static pages and no money transactions, then HTTP would be just fine. But, if you have a business website, a blog or a shopping cart, where there are many money transactions happening over the internet, then your website should be completely secure while transferring the data i.e. credit cards details, passwords etc, over the internet.

Please note that if you want to apply redirect from HTTP to HTTPS you require a SSL Certificate also known as Secure Sockets Layer Certificate.

Redirecting You Website From HTTP To HTTPS

You can redirect form HTTP to HTTPS in CPanel by two ways:

By Using The Redirect Tab In CPanel

  • Open your website URL with CPanel in any browser. The URL will look something like “https://www.yourdomainname.com/cpanel“.
  • Fill in the Username and the Password and click the Log In button, Your will be able to log in to CPanel successfully.
  • After login in go to the Domains section in cpanel and click the Redirects tab.
Redirects In Domains
  • Choose the Type as Permanent (301), since you want to permanently redirect the URL
  • Choose you domain name from https?://(www.)?, in my case its conveyarena.com
  • Keep the root (/) directory as it is
  • Type the complete URL you want to redirect to, in the Redirects To section. In my case its “https://www.conveyarena.com/
  • Choose an option from www. redirection: that suits you best.
  • Click on the Add button.
Redirecting From HTTP To HTTPS
  • Under the Current Redirects you will see your website URL added successfully, so that it automatically redirects from HTTP to HTTPS.
Redirecting Successful

By Adding Code To The Htaccess File

  • Open your website URL in any browser. The URL will look something like “https://www.yourdomainname.com/cpanel“.
  • Fill in the Username and the Password and click the Log In button, Your will be able to log in to CPanel successfully.
  • After login in, go to the Files Section on CPanel and Click on File Manager.
  • A new window will open up. On that new window, click on the public_html to access your website files.
  • Click on Settings, Choose Show Hidden Files, Click on Save.
  • Right Click on the .htaccess file and open it by clicking Edit.
  • Add the Code given below, to the original code.
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^yourdomainname.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.yourdomainname.com$
RewriteRule ^/?$ "https\:\/\/www.yourdomainname.com\/" [R=301,L]

OR

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Any of the above codes will work just fine.

The entire code will look like

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^yourdomainname.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.yourdomainname.com$
RewriteRule ^/?$ "https\:\/\/www.yourdomainname.com\/" [R=301,L]

OR

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

You can choose the method you want, as both the methods are relatively easy. Redirecting your website from HTTP to HTTPS is a necessity nowadays, since the trustworthiness of your website increases and in turn it will be easily indexed by the search engine to show higher in the result when someone is looking for your website.

Also See,

Create And Delete A Subdomain in CPanel

Your IP Address Has Changed (CPanel Error)

Best WordPress Plugins For Internal Linking Of Website

A passionate & enthusiastic blogger & part of the Team at Convey Arena, a website, that deals in Affiliate Marketing, Blogging, SEO, Web Hosting and WordPress.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top