Our blog

 

Htaccess Force SSL with Redirect (Non Standard SSL Port Compatible)

Check out this little snippet of htaccess code to force SSL usage. Works regardless of port.

CODE:
  1. RewriteEngine On
  2. RewriteCond %{HTTPS} off
  3. RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

More...

More Reading:

2 Comments

Jim
August 25th, 2010

Why is the RewriteCond "off" ??

shouldn't it be "on" instead?

I am new to this so please bear with me

 

admin
August 26th, 2010

The condition bit is checking for the situation when we should do the redirect

so logically its saying, if NOT https, then redirect to https

 

 

Leave a Reply