Skip to content

Instantly share code, notes, and snippets.

@andrew-smart
Created October 6, 2015 08:45
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 andrew-smart/62733f859455b796d389 to your computer and use it in GitHub Desktop.
Save andrew-smart/62733f859455b796d389 to your computer and use it in GitHub Desktop.
HTTP to HTTPS redirect
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_METHOD} !=POST
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment