There was a problem loading the comments.

Redirect all website traffic from http to https with the htaccess file

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

This knowledge base article applies to cPanel hosting only.

 

Follow the steps below to redirect all requests on your website from port 80 / http to port 443 / https
Download your .htaccess file from the public_html directory or use the file manager within cpanel to edit the .htaccess file

With the .htaccess file open and ready for editing, change the following

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

to 

<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Save the file and upload to the server, or in the case of using the file manager - click save and close


Share via
Did you find this article useful?  

Related Articles

Tags

© Rackzar