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 reliable and affordable web hosting with Dedicated Customer Support?

Get your web hosting today and receive a FREE domain for Life. 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

Domain Pricing for Registration, Renewal, and Transfer of domains

Are you looking for domain price list? Please refer to the following section of the "Domain...

Domains Not Covered by ID Protection

This list is continuously changing with the release of new domain extensions. We cannot guarantee...

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 - Domain Transfers (OVERVIEW)

Some common questions we get regarding domain transfers are outlined below. As we receive...

Powered by WHMCompleteSolution