Skip to content

Instantly share code, notes, and snippets.



Created Jan 22, 2019
What would you like to do?
Heroku force ssl
##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