Knowledge Base

How to setup redirection to https using .htaccess file

Once you’ve setup SSL on your account, it is recommended to make sure all of your web traffic comes from https instead of http.

To force usage of https, follow this process.

In cPanel, goto Filemanager and open public_html folder. If this file is already present, select it and click edit. Otherwise, create a new one.

Look in the file if “RewriteEngine On” is present. If not, paste the following code:

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

If the code “RewriteEngine On” is already present, remove the line from the above code. Make sure that it is not present twice.