Skip to main content

meaning of life

How-to: htaccess and SSL redirects

So, you've got a site that you want to require SSL on, but not for certain pages? I couldn't seem to make sense of most of the documentation out there on Apache's mod_rewrite module, so after 3 days I finally came up with the rules that work for this task. I figured I'd put them up here to help anybody else who runs into a similar requirement, and so that I have it sitting somewhere that I won't forget about it!

<ifmodule>RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/cron\.php$
RewriteCond %{REQUEST_URI} !^/mysql.php$

Syndicate content