Tag Archives: linux

How do I use a .htaccess rewrite to force HTTPS on a domain?

You are able to force HTTPS on a domain with an SSL, using the following 3 lines in a .htaccess file, in the root directory (or the directory you wish to force SSL on)

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://{domain name}/$1 [R,L]
Where {domain name} is for example http://www.mysau.com.au

Tagged , , ,