Skip to content

Instantly share code, notes, and snippets.

@iloris
iloris / htaccess
Created June 13, 2012 22:21 — forked from parvez/htaccess
Force HTTPS with Rewrite Rule
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://www.mydomain.com%{REQUEST_URI} [L,R]
RewriteCond %{HTTP_HOST} ^mydomain.com [NC]
RewriteRule ^.*$ https://www.mydomain.com%{REQUEST_URI} [L,R]