Force SSL

SSL
Htacess

1 Min Read

April 23rd, 2018

By Gregory

There are a few ways to force users to the secure (HTTPS) version of your site. All require the use of a .htaccess file. The method to use depends on your hosting company. It is safe to try all to see which works.

Method 1:

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

Method 2:

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

Method 3:

RewriteEngine On
RewriteCond %{HTTPS} off [OR] 
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

Did you enjoy this post ?

Share and let all people receive the benefits

Related Articles

A great tool to grade your website in seconds for free

SEO
Website Grader
Grade

October 16th, 2020

2 Min Read

Turn off Directory Listing in .htaccess file

Htacess

August 20th, 2018

1 Min Read

RapidWeaver 404 pages

Htacess
404
Redirect

May 14th, 2018

1 Min Read

Cart is Empty

You haven't added anything, please add something

FormPlus

Forms, function, and so much more.

You want to ask a lot of questions.

Lets Talk !