Created
March 31, 2017 15:25
-
-
Save kevinquillen/dc694bc64c98b52daed0b8dbae1028f6 to your computer and use it in GitHub Desktop.
Example htaccess rule to force all traffic over HTTPS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Force all traffic to HTTPS, except a local instance | |
RewriteCond %{HTTPS} off | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteCond %{HTTP_HOST} !^mysite\.local$ [NC] | |
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