Skip to content

Instantly share code, notes, and snippets.

@spidersea
Created December 24, 2013 08:36
Show Gist options
  • Save spidersea/8110415 to your computer and use it in GitHub Desktop.
Save spidersea/8110415 to your computer and use it in GitHub Desktop.
RewriteEngine On
RewriteCond %{HTTPS} =off
RewriteCond %{REQUEST_URI} !^\/page1\/
RewriteCond %{REQUEST_URI} !^\/page2\/
RewriteRule (.*) https://%{HTTP_HOST}/$1 [L,R=301]
RewriteCond %{HTTPS} =on
RewriteCond %{REQUEST_URI} \/page1\/ [OR]
RewriteCond %{REQUEST_URI} \/page2\/
RewriteRule (.*) http://%{HTTP_HOST}/$1 [L,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment