# Udate to 4.2 runs into ERR\_TOO\_MANY\_REDIRECTS

**URL:** <https://forum.mautic.org/t/udate-to-4-2-runs-into-err-too-many-redirects/23277>\
**Category:** Product Support\
**Created:** [March 24, 2022, 9:44pm UTC](https://forum.mautic.org/t/udate-to-4-2-runs-into-err-too-many-redirects/23277 "2022-03-24T21:44:47Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [March 24, 2022, 9:44pm UTC](https://forum.mautic.org/t/udate-to-4-2-runs-into-err-too-many-redirects/23277/1 "2022-03-24T21:44:47Z")

</div>

**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.

Many thanks for your help

Christian

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 25, 2022, 9:23am UTC](https://forum.mautic.org/t/udate-to-4-2-runs-into-err-too-many-redirects/23277/2 "2022-03-25T09:23:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [March 25, 2022, 1:05pm UTC](https://forum.mautic.org/t/udate-to-4-2-runs-into-err-too-many-redirects/23277/3 "2022-03-25T13:05:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 25, 2022, 1:32pm UTC](https://forum.mautic.org/t/udate-to-4-2-runs-into-err-too-many-redirects/23277/4 "2022-03-25T13:32:38Z")

</div>

Hi, can you confirm, that the right https value is in your local.php file?  
Also:  
what happens if you add

`$_SERVER['HTTPS'] = 'on';`

To second line in index.php just after the opening php tag?

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [March 25, 2022, 2:24pm UTC](https://forum.mautic.org/t/udate-to-4-2-runs-into-err-too-many-redirects/23277/5 "2022-03-25T14:24:46Z")

</div>

No change, same 403 error, unfortunately.

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [March 25, 2022, 2:37pm UTC](https://forum.mautic.org/t/udate-to-4-2-runs-into-err-too-many-redirects/23277/6 "2022-03-25T14:37:20Z")

</div>

Can you try to access mautic via incognito mode / private mode browser ?

Also please run this command from mautic root directory

rm -rf var/cache/dev/\* var/cache/prod/\*

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [March 25, 2022, 2:46pm UTC](https://forum.mautic.org/t/udate-to-4-2-runs-into-err-too-many-redirects/23277/7 "2022-03-25T14:46:29Z")

</div>

No change with this, too.

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [March 31, 2022, 8:28pm UTC](https://forum.mautic.org/t/udate-to-4-2-runs-into-err-too-many-redirects/23277/8 "2022-03-31T20:28:05Z")

</div>

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.

Kind regards and many thanks for your help

Christian

---

<div class="post-metadata">

**Author:** ![wayneoutthere](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/wayneoutthere/32/13447_2.png) [@wayneoutthere](https://forum.mautic.org/u/wayneoutthere)\
**Post date:** [January 2, 2025, 12:22am UTC](https://forum.mautic.org/t/udate-to-4-2-runs-into-err-too-many-redirects/23277/9 "2025-01-02T00:22:03Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 2, 2025, 12:40pm UTC](https://forum.mautic.org/t/udate-to-4-2-runs-into-err-too-many-redirects/23277/10 "2025-01-02T12:40:45Z")

</div>

Hi,

I am huge advocate of ‘Don’t poke if its works’, but here is the reason:

1. 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.

2. 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:

```auto
if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
    $_SERVER['HTTPS'] = 'on';
}

```

I hope this helps.

---

<div class="post-metadata">

**Author:** ![wayneoutthere](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/wayneoutthere/32/13447_2.png) [@wayneoutthere](https://forum.mautic.org/u/wayneoutthere)\
**Post date:** [January 2, 2025, 1:38pm UTC](https://forum.mautic.org/t/udate-to-4-2-runs-into-err-too-many-redirects/23277/11 "2025-01-02T13:38:50Z")

</div>

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).

Thanks again sir!
