# Invalid trusted host value stops Mautic from working

**URL:** https://forum.mautic.org/t/invalid-trusted-host-value-stops-mautic-from-working/14259
**Category:** Product Support
**Created:** [May 10, 2020, 7:06am UTC](https://forum.mautic.org/t/invalid-trusted-host-value-stops-mautic-from-working/14259 "2020-05-10T07:06:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rdh001](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rdh001/32/666_2.png) [@rdh001](https://forum.mautic.org/u/rdh001)
#### Post date: [May 10, 2020, 7:06am UTC](https://forum.mautic.org/t/invalid-trusted-host-value-stops-mautic-from-working/14259/1 "2020-05-10T07:06:39Z")

</div>

**Your software**  
My Mautic version is: unknown – I’m locked out  
My PHP version is: 7.1

**Your problem**  
I added an invalid value to the Trusted Hosts list in my configuration. Saving the change immediately locked me out of my Mautic site.

There is an old (closed) thread on GitHub which is discussing this same problem that I have. There is a somewhat incomplete solution posted, but requests for more detail went unanswered.

GitHub thread: [https://github.com/mautic/mautic/issues/4315](https://github.com/mautic/mautic/issues/4315)

These errors are showing in the log:  
Line 1: [2020-05-10 03:02:53] mautic.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException: “Untrusted Host “mautic.xyz.info”” at /var/www/html/mautic/vendor/symfony/http-kernel/EventListener/RouterListener.php line 120 {“exception”:"[object] (Symfony\Component\HttpKernel\Exception\BadRequestHttpException(code: 0): Untrusted Host “mautic.xyz.info” at /var/www/html/mautic/vendor/symfony/http-kernel/EventListener/RouterListener.php:120, UnexpectedValueException(code: 0): Untrusted Host “mautic.xyz.info” at /var/www/html/mautic/app/bootstrap.php.cache:950)"}

Steps I have tried to fix the problem:  
The suggested solution on Github was:  
“_The solution in this scenario was to edit the local.php file in app/config and then manually clear the cache._”

I found the offending line in:  
var/www/html/mautic/app/config/local.php

I recognize the incorrect domain I entered by mistake. So I have changed that back to the correct domain.

The second part of the suggested solution is: “…_then manually clear the cache._” I renamed the app/cache directory, rather than deleting it.

I tried to reset permissions and got a message saying “cannot access ‘/var/www/html/mautic/’”

I tried to restart Apache and got the message. “Failed to restart apache2.service: Unit apache2.service not found”.

If I access the site with the IP address, I get the Apache2 Ubuntu Default Page, which says:  
“_If you can read this page, it means that the Apache HTTP server installed at this site is working properly._”

The error persists, and I’m completely lost. Any help much appreciated.

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [May 11, 2020, 7:41am UTC](https://forum.mautic.org/t/invalid-trusted-host-value-stops-mautic-from-working/14259/2 "2020-05-11T07:41:35Z")

</div>

3 posts were merged into an existing topic: [Untrusted Host error](https://forum.mautic.org/t/untrusted-host-error/8787)

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [May 11, 2020, 7:41am UTC](https://forum.mautic.org/t/invalid-trusted-host-value-stops-mautic-from-working/14259/3 "2020-05-11T07:41:35Z")

</div>



---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [May 11, 2020, 7:43am UTC](https://forum.mautic.org/t/invalid-trusted-host-value-stops-mautic-from-working/14259/4 "2020-05-11T07:43:05Z")

</div>

A post was merged into an existing topic: [Untrusted Host error](https://forum.mautic.org/t/untrusted-host-error/8787)
