I\'m trying to use apache2\'s mod_rewrite to force SSL connections to a website. So far, it\'s working fine with the following in the site\'s
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^thing/add/\d+/page3$ - [L]
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(thing/add/\d+/page3) $ http://%{HTTP_HOST}/$1 [QSA,NC,R,L]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [QSA,NC,R,L]
The rules are processed top to bottom; the first one stops rewrite for maps page if not on SSL; the second one (optional) redirects these pages to non-secure if accessed via SSL; for all else, the old rule applies.