Skip to content

Instantly share code, notes, and snippets.

@jonathonsim
Last active April 14, 2020 00:11
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 jonathonsim/63d0c508c3e62b7543270421b1fdd150 to your computer and use it in GitHub Desktop.
Save jonathonsim/63d0c508c3e62b7543270421b1fdd150 to your computer and use it in GitHub Desktop.
Redirect http requests to https
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment