Created
January 22, 2019 18:22
-
-
Save phumpal/25818dc3a83ad8dd860ac85e3b9761c2 to your computer and use it in GitHub Desktop.
Heroku force ssl
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
| ##Force SSL | |
| #Normal way (in case you need to deploy to NON-heroku) | |
| RewriteCond %{HTTPS} !=on | |
| #Heroku way | |
| RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
| #If neither above conditions are met, redirect to 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