Mautic Redirect Loop

Your software
My Mautic version is: 3.1.2
My PHP version is: 7.4
My Database type and version is: 10.3.25

Your problem
After Cache clear Mautic get’s stuck in a 302 redirect loop. says Mautic redirects 19 times. 20 if you start with an http link to the site

This causes browsers to give up. And report that the site has issues.

These errors are showing in the log:
Hmm oddly my install has no errors in Apache’s log or Mautic’s log for the day. So nothing to report here.

Notice some scuttle bud on the web about Symphony redirect issues. But I’ve not found a concrete solution yet. Anyone come across this? :bug:

Steps I have tried to fix the problem:

  • I’ve tried clearing the cache several ways (deleting files in cache directory or console commands).
  • I repair the issue by time-travel to a time before cache is cleared. But this is not sustainable since I’ll need to clear cache at some point in the near future.

A little known fact. Mautic + Proxies = Redirects.

Found this little gem in an obscure bit of Mautic’s documentation.

Still searching where to set this up.

could you add this line to the beginning of your index.php?
$_SERVER[‘HTTPS’] = ‘on’;

Let me know if this fixes the issue.

1 Like

Thanks @Joeyk , that gets me down to 3 redirects. And the site is at least functional again.

302 Found
302 Found
302 Found
200 OK

Okay, that is something. :slight_smile:

Do you have ‘https’ in your /config/local.php?
Also - do you use cloudflare? Who handles your SSL? Is it haproxy?

Indeed is much better. :grinning:

  • Yes I’ve added https in the local.php config before running into this.
  • I use Haproxy to handle the SSL.