Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lara1376's avatar

HTTPS on heroku

Not sure if anyone else is having a similar issue and gave up, but here goes:

I'm hosting an app on heroku and am using CloudFlare's free SSL to serve all traffic over HTTPS.

Here's the following from my app/filters.php file:

App::before(function($request)
{
  if ((Request::header('x-forwarded-proto') <> 'https') && !App::environment('local'))
  {
    return Redirect::secure(Request::getRequestUri());
  }
});

Link to StackOverflow

For some reason, this breaks all the forms as none of them seem to POST to where they should.

Can anyone help? Thanks!

0 likes
0 replies

Please or to participate in this conversation.