# All email urls are overwritten with Mautic site url, if sending through a campaign

**URL:** <https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019>\
**Category:** Product Support\
**Created:** [May 6, 2022, 3:36pm UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019 "2022-05-06T15:36:27Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ilo/32/1181_2.png) [@ilo](https://forum.mautic.org/u/ilo)\
**Post date:** [May 6, 2022, 3:36pm UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019/1 "2022-05-06T15:36:27Z")

</div>

**Your software**  
My Mautic version is: 4.2.1 Mautic docker container behind an IIS server with reverse proxy

**Your problem**  
My problem is:  
If sending an email though a campaign ( I am using SendGrid-API as sending service with tracking clicks disabled) all the urls (including Linkedin or any other random website) are overwritten with the Mautic’s site url.  
If sending as example, all links work ok (probably because there is no tracking and no redirect is necessary)

These errors are showing in the log:  
No errors.

Steps I have tried to fix the problem:  
I have no idea where to start & look to solve this issue. I would appreciate any hint. Thanks.

---

<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:** [May 7, 2022, 8:30am UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019/2 "2022-05-07T08:30:39Z")

</div>

Hi, you can turn off email tracking in Mautic disabling it in the config \> email settings.  
Once you do it, no tracking url would be used to redirect your links.

---

<div class="post-metadata">

**Author:** ![ilo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ilo/32/1181_2.png) [@ilo](https://forum.mautic.org/u/ilo)\
**Post date:** [May 7, 2022, 9:59am UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019/3 "2022-05-07T09:59:53Z")

</div>

Hi, thanks for answering.  
Indeed, I can do this, but then I lose all the reporting analytics, as no UTM code gets logged anymore, neither clicks counters. I don’t think this is an expected functionality, as with an older version I don’t have this issue. Thanks!

---

<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:** [May 7, 2022, 2:25pm UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019/4 "2022-05-07T14:25:30Z")

</div>

Okay wait. Url tracking only works is your mautic is rewriting the urls. Maybe I misunderstood your problem.

---

<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:** [May 7, 2022, 2:26pm UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019/5 "2022-05-07T14:26:09Z")

</div>

Can you send me an example link that doesnt work in pm?

---

<div class="post-metadata">

**Author:** ![ilo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ilo/32/1181_2.png) [@ilo](https://forum.mautic.org/u/ilo)\
**Post date:** [May 9, 2022, 4:59am UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019/6 "2022-05-09T04:59:24Z")

</div>

Yes, I’ll send you such an url in a pm.  
So, the problem is that the url gets redirected (the final destination) to Mautic’s domain, although it’s a linkedin link in email.  
Thanks for looking into it.

---

<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:** [May 9, 2022, 5:18am UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019/7 "2022-05-09T05:18:36Z")

</div>

Okay, is the email published?

---

<div class="post-metadata">

**Author:** ![ilo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ilo/32/1181_2.png) [@ilo](https://forum.mautic.org/u/ilo)\
**Post date:** [May 9, 2022, 5:40am UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019/8 "2022-05-09T05:40:28Z")

</div>

Yes, it is. It’s public & published.

---

<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:** [May 9, 2022, 5:54am UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019/9 "2022-05-09T05:54:18Z")

</div>

Are you sure your link is okay?  
If I replace to [https://linkedin.com/](https://linkedin.com/) from your domain, it works.  
I suspect you didn’t add the right link to the URL.  
It should start with https://

---

<div class="post-metadata">

**Author:** ![ilo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ilo/32/1181_2.png) [@ilo](https://forum.mautic.org/u/ilo)\
**Post date:** [May 9, 2022, 6:00am UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019/10 "2022-05-09T06:00:22Z")

</div>

Yes, I’ve rechecked all of them many times. All the links work fine if the email is not sent through a campaign. Also, in Email stats, in Mautic / Click Counts they are counted & displayed as expected. So, only the redirect fails, if the destination is other than mautic domain.

---

<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:** [May 9, 2022, 6:06am UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019/11 "2022-05-09T06:06:12Z")

</div>

Could you plz pm me the original link?

---

<div class="post-metadata">

**Author:** ![ilo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ilo/32/1181_2.png) [@ilo](https://forum.mautic.org/u/ilo)\
**Post date:** [May 25, 2022, 7:46am UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019/12 "2022-05-25T07:46:28Z")

</div>

In case anyone will have the same issue and land here: the issue was at server level. Rewrite headers was forced on server level, but should not do this by default. Once this was disabled, the urls work fine.

@joeyk thanks again for your support.

---

<div class="post-metadata">

**Author:** ![richmarks20](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/richmarks20/32/7266_2.png) [@richmarks20](https://forum.mautic.org/u/richmarks20)\
**Post date:** [March 1, 2023, 12:01pm UTC](https://forum.mautic.org/t/all-email-urls-are-overwritten-with-mautic-site-url-if-sending-through-a-campaign/24019/13 "2023-03-01T12:01:27Z")

</div>

For those using IIS and AAR to rewrite, the above is acheived by unticking the “Reverse rewrite host in response headers” is **unchecked** in proxy server settings. See [this serverfault post](https://serverfault.com/a/1124033/951252) for more detail.
