Skip to content

Instantly share code, notes, and snippets.

@badcrc
Created May 6, 2014 08:08
Show Gist options
  • Save badcrc/4303bae0643f5675bee6 to your computer and use it in GitHub Desktop.
Save badcrc/4303bae0643f5675bee6 to your computer and use it in GitHub Desktop.
Behind a proxy which sends the protocol of the request in the header X-Forwarded-Protocol, redirect to https if the request is in plain http.
RewriteCond %{HTTP:X-Forwarded-Protocol} !^https$
RewriteRule ^some/url/(.*)$ https://%{HTTP_HOST}/some/url/$1 [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment