Skip to content

Instantly share code, notes, and snippets.

@waako
Created July 14, 2016 15:16
Show Gist options
  • Save waako/c511a654c43180e3c90af37e5344c252 to your computer and use it in GitHub Desktop.
Save waako/c511a654c43180e3c90af37e5344c252 to your computer and use it in GitHub Desktop.
redirect all traffic to https, except one page, and ensure that page is served on http
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/who-we-are/careers$ [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Ensure that Careers page is not forced over HTTPS
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} ^/who-we-are/careers$ [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@fbzoltan
Copy link

Works great! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment