Redirect my cPanel website to HTTPS

Once you’ve installed your SSL certificate on your Linux 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.

Step 1 of 11

Start by logging in to your Control Panel and scroll down to ‘Web Hosting’. From there, select ‘Manage’.

Manage Web Hosting

Step 2 of 11

On the next page, select ‘Manage’ for the account you wish to use.

Web Hosting Manage

Step 3 of 11

Select the three-dot icon for the package you want to edit. From there, choose ‘Settings’ from the drop-down menu that appears.

cPanel Admin

Step 4 of 11

Select File Manager in the account dashboard.

Step 5 of 11

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

Settings

Step 6 of 11

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

Preferences

Step 7 of 11

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

Step 8 of 11

Select your .htaccess file and click Edit.

htaccess

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

Step 9 of 11

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

Edit

Step 10 of 11

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 11 of 11

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

Save