Skip to content

Instantly share code, notes, and snippets.

@l4ci
Created January 9, 2018 10:14
Show Gist options
  • Save l4ci/566c07af468e2c0e5161c89a13a3e1d7 to your computer and use it in GitHub Desktop.
Save l4ci/566c07af468e2c0e5161c89a13a3e1d7 to your computer and use it in GitHub Desktop.
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Alternative via Port
#RewriteCond %{SERVER_PORT} !^443$
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment