How do I force SSL / HTTPS on my domain or site on Cpanel

Prior to completing these steps you need to ensure that a valid SSL certificate is in place for the domain you want to force SSL on.  This can be a purchased via our shop:

To force SSL connections to a site, you need use the cPanel File Manager to add or edit the .htaccess file for the folder containing the site.

You need to ensure that you show hidden files (dotfiles) when opening the File Manager.

Add the following at the top of the file:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Clear your browser cache and re-test.

When viewing the site, your browser should now automatically load over HTTPS.

  • SSL, force, traffic, certificate
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Default Nameservers for Hostraight

If you're using any form of shared hosting with us at Hostraight, the nameservers are Below:...

How can I transfer a domain into my account

Before initiating the transfer of a non-UK domain (e.g. .COM / .NET / .ORG) you will need to...

How do I add another domain to my Hosting Account?

To add a new domain to your existing hosting account: 1. Log into your cPanel control panel2....

How do I update the name servers on my domain?

To update the name servers on a domain, please follow the instructions below:1. Login to your...

Powered by WHMCompleteSolution