Knowledgebase
Force website to load HTTPS using .htaccess
Posted by Chris Gebhardt on August 09 2017 02:21 PM

If you have a SSL certificate on your website, depending on your particular configuration your website may not use HTTPS by default.

To force all web traffic to use HTTPS, put the following lines of code in the .htaccess file in your website’s root folder.

Important:If you have existing code in your .htaccess, add this above where there are already rules with a similar starting prefix.

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

Be sure to replace www.example.com with your actual domain name.

Note that if you are utilizing a CMS / dynamic website (ie: WordPress, Joomla, etc) then your software may have another way to set for HTTPS, and you should check with that documentation.

 

(3 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: