Skip to content

Instantly share code, notes, and snippets.

@brickgale
Last active January 28, 2022 16:24
Show Gist options
  • Save brickgale/f903c2c98ab501d2e604a3c18c3fb115 to your computer and use it in GitHub Desktop.
Save brickgale/f903c2c98ab501d2e604a3c18c3fb115 to your computer and use it in GitHub Desktop.
Laravel force https for Heroku
#add this on public/.htaccess for Laravel
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
web: vendor/bin/heroku-php-apache2 public/
@danielrob
Copy link

Nice one!

@brickgale
Copy link
Author

ahh, okay. i was working with lower version of laravel (5.1-5.3) when i made this. Good catch! It was just a middleware problem. Thanks @danielrob!

@lvidal1
Copy link

lvidal1 commented Dec 28, 2019

This is gold. Thanks @brickgale. You saved my weekend!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment