How to Force my Website to use SSL Certificate

If you have a secure certificate (SSL) on your website, you can automatically redirect visitors to the secured (HTTPS) version of your website to make sure their information is protected.

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.

Adding the following code at the top of your .htaccess file, automatically redirects visitors to the HTTPS version of your site:


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


If you have an existing .htaccess file:

  • Do not duplicate RewriteEngine On.
  • Make sure the lines beginning RewriteCond and RewriteRule immediately follow the already-existing RewriteEngine On.

 


Looking for fast and reliable web hosting with dedicated customer support?

Order your web hosting plan now, and get one domain free for 1st year. All plans come with our 30 Day Money Back Guarantee!

  • cPanel, SSL-Certificate, Websites
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

FAQ - Affiliate Program

Here you'll find answers to some of the most frequently asked questions about our Affiliate...

FAQ - Affiliate Program

Here you'll find answers to some of the most frequently asked questions about our Affiliate...

FAQ - Softaculous (OVERVIEW)

What is Softaculous?Softaculous is a one-click auto installer for cPanel servers. It provides end...

FAQ - Softaculous (OVERVIEW)

What is Softaculous?Softaculous is a one-click auto installer for cPanel servers. It provides end...

How to migrate your website FROM another host TO Magic Hosting

Moving to us couldn't be easier. Simply order any of our hosting plans and we'll take care of...

Powered by WHMCompleteSolution