Redirect URL from HTTP To HTTPS In cPanel

Interested in knowing, how to redirect URL from HTTP To HTTPS In cPanel? You have come to the right place for the answer.

Many of you might be facing this problem, while working on your website. Your website url 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.

But first let’s understand what the difference between HTTP & HTTPS actually is.

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.

Redirect URL from HTTP To HTTPS In cPanel

Redirect URL from HTTP To HTTPS In cPanel

You can redirect your website url form HTTP to HTTPS in cPanel by two different ways.

By Using The Redirect Tab In cPanel

1). 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. You will log in to cPanel successfully. After login in go to the Domains section in cPanel and click the Redirects tab.

Redirect Tab In cPanel Domains

2). 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 In cPanel

3). Under the Current Redirects you will see your website URL added successfully & it will now automatically redirects from HTTP to HTTPS.

Redirecting Successful In cPanel

By Adding Code To The Htaccess File

1). 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 successfully log in to your cPanel.

2). 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.

3). Now, click on Settings & choose Show Hidden Files. Click on Save.

4). 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]

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]

Conclusion

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 engines to show higher in the result when someone is looking for your website. Also dealing with this in cPanel is effortless.

You may also like,

Leave a Reply

Your email address will not be published.

Scroll to Top
Copy link
Powered by Social Snap