# Redirecting While Preserving URL Parameters

**URL:** <https://forum.mautic.org/t/redirecting-while-preserving-url-parameters/30565>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [January 19, 2024, 8:52am UTC](https://forum.mautic.org/t/redirecting-while-preserving-url-parameters/30565 "2024-01-19T08:52:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter\_k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/peter_k/32/511_2.png) [@peter\_k](https://forum.mautic.org/u/peter_k)\
**Post date:** [January 19, 2024, 8:52am UTC](https://forum.mautic.org/t/redirecting-while-preserving-url-parameters/30565/1 "2024-01-19T08:52:31Z")

</div>

Hey there,

I’m having an issue with URL parameter handling when redirecting from an email link to an unpublished landing page that redirects.

**TL;DR**  
Mautic swallows URL query parameters while redirecting a user from  
`email link click > unpublished landing page > published landing page`.

**Use Case**  
I want to track certain link clicks in my emails. The user should get a thank-you message after clicking. Additionally, I’d like to show a feedback form on this page.

To add a bit of context to the feedback I’d like to store the email ID in a hidden input field. That’s why I need to pass on URL parameters (`eid`).

I could simply clone the thank-you page and directly to it, but I don’t want to have multiple of the same thank-you pages that I need to keep in sync. Hence, the redirects to a canonical thank-you page.

**The Setup:**

- I have an email with a link to a Mautic Landing Page. The link contains a URL parameter: `{pagelink=13}?eid=43`.
- The landing page `13` itself is unpublished and is set up to redirect (302) to `https://mautic.mypage.com/thank-you`.

**The Goal:**

- I want to pass the `eid` query parameter through this redirect, so the final URL should be `https://mautic.mypage.com/thank-you?eid=43`.

**The Problem:**

- Currently, when a user clicks the link from the email, they land on `https://mautic.mypage.com/thank-you` but without the `eid=43` parameter.
- From what I understand at looking at the source, the [PageBundle/Controller/PublicController](https://github.com/mautic/mautic/blob/a8c2f81324462f73d4192ab19dc43890683d2e7e/app/bundles/PageBundle/Controller/PublicController.php#L456) should append the original query parameters to the redirect URL.

It just doesn’t seem to be happening 😅  
This is the redirect chain.

| URL | Status | Type |
| --- | --- | --- |
| mautic.mysite .com/r/f94cda0b032abef161de1b170?ct=YTo1O[…]6NDQ7%3D&utm\_source=mautic&utm\_medium=email… | 302 | document / Redirect |
| mautic.mysite .com/feedback-link-3? **eid=43** &utm\_source=mautic&utm\_medium[…] ←_eid param_ | 302 | document / Redirect |
| mautic.mysite .com/thank-you _← no eid param_ | 200 | document |

You can see that the redirect from the landing page swallows the URL query/queries.

**Questions**

- Am I misunderstanding how Mautic handles query parameters in redirects for unpublished pages?
- Has anyone else experienced this issue, and if so, how did you resolve it?
- Could there be a specific setting or configuration I’m missing?

Any insights or suggestions would be greatly appreciated.
