Skip to content

Instantly share code, notes, and snippets.

@j26design
Last active February 1, 2016 20:04
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 j26design/60c649a5efd7cf1ca6e2 to your computer and use it in GitHub Desktop.
Save j26design/60c649a5efd7cf1ca6e2 to your computer and use it in GitHub Desktop.
Redirect specific domain to or away from https
# Redirect to https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} example\.com$ [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
# Redirect to http
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} example\.com$ [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment