Skip to content

Instantly share code, notes, and snippets.

@meineerde
Created June 19, 2010 17:13
Show Gist options
  • Save meineerde/445073 to your computer and use it in GitHub Desktop.
Save meineerde/445073 to your computer and use it in GitHub Desktop.
RewriteEngine On
# See reverse rule in host.domain__https.conf
# Update accordingly!
RewriteRule ^/(login|users/edit|my/password)(/.*)?$ https://host.domain/$1$2 [L,QSA,R=301]
# See reverse rule in host.domain__http.conf
# Update accordingly!
RewriteCond %{REQUEST_URI} !^/(login|users/edit|my/password|svn)
# These are protocol preserved
RewriteCond %{REQUEST_URI} !^/(themes|stylesheets|javascripts|images|favicon.ico)
RewriteRule ^/(.*)$ http://host.domain/$1 [L,QSA,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment