Skip to content

Instantly share code, notes, and snippets.

@phumpal
Created January 22, 2019 18:22
Show Gist options
  • Select an option

  • Save phumpal/25818dc3a83ad8dd860ac85e3b9761c2 to your computer and use it in GitHub Desktop.

Select an option

Save phumpal/25818dc3a83ad8dd860ac85e3b9761c2 to your computer and use it in GitHub Desktop.
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