Created
December 20, 2016 14:59
-
-
Save devilankur18/3aa79acfa4894a5a4cb2af19802dc8b2 to your computer and use it in GitHub Desktop.
HTML5 AWS ELB force https
This file contains hidden or 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
RewriteEngine on | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteCond %{HTTP_USER_AGENT} !^ELB-HealthChecker/1.0 | |
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L] | |
# Don't rewrite files or directories | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^ - [L] | |
# Rewrite everything else to index.html to allow html5 state links | |
#RewriteRule ^ index.html [L] | |
RewriteCond ${REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)$ index.html [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment