Skip to content

Instantly share code, notes, and snippets.

@lfbittencourt
Created February 7, 2017 13: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 lfbittencourt/d3be88c3bdf4522ac2cbc67b405dea4f to your computer and use it in GitHub Desktop.
Save lfbittencourt/d3be88c3bdf4522ac2cbc67b405dea4f to your computer and use it in GitHub Desktop.
Force SSL/https without redirect loop
<IfModule mod_rewrite.c>
RewriteEngine On
# Force SSL
RewriteCond %{HTTP:X-Forwarded-Proto} !https
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