Your software
My Mautic version is: 4.2
My PHP version is: PHP 7.4.28
My Database type and version is: Ver 15.1 Distrib 10.5.12-MariaDB, for debian-linux-gnu (x86_64)
Your problem
My problem is: ERR_TOO_MANY_REDIRECTS
These errors are showing in the log:
Steps I have tried to fix the problem: Deleted /var/cache/*
I updated successfully via command line. Since then the page is not accessible.
I have another Mautic (4.2) running on the same server. This one is running without problems although it is running on the same Apache server.
Hi, I smell an SSL error or URL setting problem in the air.
Can you check if you are using the right protocol in your config file and not http instead of https?
It’s in /app/config/local.php if you can’t open your Mautic’s config page.
Many thanks Joey, I checked this and I’m using https.
What seems strange to me is that this other installation (on the same server) is running perfect. And I did there the same update from 4.0 to 4.2 three weeks ago.
It turned out that the problem was not on Mautic site, as assumed by most of you, but on the redirect site.
I’m sorry for that, and thankful, for your all help!
I changed the redirect and now it is working properly.
Why this change came with Mautic 4.2 I can’t tell.
I’m using ispConfig for the server management and had there configured a 301 redirect to the mautic folder.
Now I changed it via Apache directives and changed the Document Root path.
Hi @joeyk First, you have awesome videos. Super fantastic and thank you. I’m starting to dig into mautic and you are the main reason I’m making progress. You are appreciated.
For this response you gave here, I applied it, and it worked! But… I want to know why it worked and why, if it solves this problem, it is not simply included in the default code…
To be clear, this code:
$_SERVER['HTTPS'] = 'on';
Sorry for the technical request but I try to learn and grow with each frustration I go through.
Thanks again for the solution and look forward to the response !
I am huge advocate of ‘Don’t poke if its works’, but here is the reason:
Maybe you are using a Proxy or Load Balancer. (like Cloudflare, AWS ELB), and the actual HTTPS termination is done on the proxy level, BUT your server servers HTTP. In this cased the $_SERVER['HTTPS'] value is not set in apache/nginx.
OR: Your web server (e.g., Apache, Nginx) may not be properly forwarding HTTPS status to PHP.
Like you said, this is a workaround.
I am not smarter then ChatGPT, giving me this fix:
Configure Your Server: Ensure that your server passes the correct HTTPS status to PHP. For example:
In Apache, enable SetEnvIf or use mod_headers to set $_SERVER['HTTPS'] correctly.
In Nginx, configure fastcgi_param HTTPS on; for HTTPS connections.
Handle Proxies Properly: If you’re using a proxy or load balancer, check for headers like X-Forwarded-Proto or X-Forwarded-Ssl. You can set $_SERVER['HTTPS'] based on these headers:
Hi Joey
Thanks yet again. In my case my setup is ‘unique’. To be precise it is HAProxy in front of 3 x Mautic containers running in Podman. It started out as an educational test, but then when it started working, I kept going. True story is it originally started running on a live USB drive but I digress…
I think the key is going to be this part:
X-Forwarded-Proto or X-Forwarded-Ssl
I recall you can explicity call that in HAProxy in the frontend so I’ll try that and then remove that code I just added and see if it works (again).