Skip to content

Instantly share code, notes, and snippets.

@modemlooper
Created January 21, 2020 01:42
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 modemlooper/7ad04d9f5b874bdaa9d443ac1a84a45f to your computer and use it in GitHub Desktop.
Save modemlooper/7ad04d9f5b874bdaa9d443ac1a84a45f to your computer and use it in GitHub Desktop.
runcloud redirect htaccess
RewriteEngine On
# If we receive a forwarded http request from a proxy...
RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR]
# ...or just a plain old http request directly from the client
RewriteCond %{HTTP:X-Forwarded-Proto} =""
RewriteCond %{HTTPS} !=on
# Redirect to https version
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