I have a Laravel 5 build running on an apache Heroku instance, and I'm trying to make sure all traffic is converted through https, but I am desperately lost.
My SSL certificate is working successfully. However, with Heroku, you cannot directly edit the .htaccess file on your server. Therefore, their recommendation this page is to configure apache_app.conf and tell Heroku to read it by placing it in the Procfile file:
web: vendor/bin/heroku-php-apache2 -C apache_app.conf public/
However, when I do this, almost any HTTPS rewrite rules that I add causes a redirect loop or application error. Here is my current configuration:
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
source
share