Redirect my cPanel website to HTTPS

Once you’ve installed your SSL certificate on your Hosting account, you’ll need to make some changes to your .htaccess file so that it automatically redirects visitors to an HTTPS version of your site.

Please note: this process applies to Web Hosting plans purchased after July 2020 and Premium Hosting plans purchased after August 2020 (cPanel).

Step 1 of 9

Start by accessing your Web Hosting dashboard.

 

Step 2 of 9

Select File Manager in the account dashboard.

 

Step 3 of 9

Select Settings from the cPanel File Manager in the top-right corner.

Settings

 

Step 4 of 9

Ensure that the Show Hidden Files (dotfiles) option is checked, and select Save.

Preferences

 

Step 5 of 9

Double-click public_html from the File Manager dashboard.
File Manager

 

Step 6 of 9

Select your .htaccess file and click Edit.

htaccess

If you don’t have a .htaccess file, click File+, name the file .htaccess and click Create New File.

 

Step 7 of 9

On the pop-up menu that appears, click Edit.

Edit

 

Step 8 of 9

If you already had a .htaccess file, you’ll need to insert the following code into it:

RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(www\.)?example\.co.uk
RewriteRule ^(.*)$ https://www.example.co.uk/$1 [R,L]

Be sure to replace example.co.uk with your own domain name though!

If you had to create a new .htaccess file, you’ll need to insert the following code into it:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(www\.)?example\.co.uk
RewriteRule ^(.*)$ https://www.example.co.uk/$1 [R,L]

Again, make sure that example.co.uk is replaced with your own domain name.

 

Step 9 of 9

Once done, select Save Changes, followed by Close in the top-right corner.

Save