Skip to content

Instantly share code, notes, and snippets.

@atuttle
Created September 7, 2012 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atuttle/3669469 to your computer and use it in GitHub Desktop.
Save atuttle/3669469 to your computer and use it in GitHub Desktop.
# force **NO** SSL for non-login, non-registration pages
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^admin\.company\.com$
RewriteCond %{URL} !^/register.cfm$
RewriteCond %{URL} !^/login.cfm$
RewriteRule ^(.*)?$ http://%{HTTP_HOST}/$1 [R=301,L]
# force SSL for login & registration pages
RewriteCond %{HTTPS} off
RewriteRule ^login.cfm(.*)$ https://%{HTTP_HOST}/login.cfm$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule ^register.cfm(.*)$ https://%{HTTP_HOST}/register.cfm$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment