Skip to content

Instantly share code, notes, and snippets.

@cyancey76
Created September 25, 2017 17:49
Show Gist options
  • Save cyancey76/e7e813073891d7040c09f15712a8e369 to your computer and use it in GitHub Desktop.
Save cyancey76/e7e813073891d7040c09f15712a8e369 to your computer and use it in GitHub Desktop.
.htaccess force SSL
# FORCE SSL
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# FORCE SSL for load balancer
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
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