# Mautic new domain error 404

**URL:** <https://forum.mautic.org/t/mautic-new-domain-error-404/16283>\
**Category:** Product Support\
**Tags:** mautic-3, discussion, community\
**Created:** [September 25, 2020, 11:08pm UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283 "2020-09-25T23:08:46Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![livetech](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/livetech/32/864_2.png) [@livetech](https://forum.mautic.org/u/livetech)\
**Post date:** [September 25, 2020, 11:08pm UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/1 "2020-09-25T23:08:46Z")

</div>

**Your software**  
My Mautic version is: 3.0.2  
My PHP version is: 7.3

**Your problem**  
My problem is: after change domain Mautic return error 404

how is the right way to change domain, in database exist anyone domain URL to put?

These errors are showing in the log:

no logs, no error.log

Steps I have tried to fix the problem:

clear cache  
remove https  
fix permissions  
fix user:groups

---

<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:** [September 26, 2020, 7:12am UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/2 "2020-09-26T07:12:05Z")

</div>

Hi,  
Edit /app/config/local.php  
(new domain)  
And then rebuild cache.

---

<div class="post-metadata">

**Author:** ![livetech](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/livetech/32/864_2.png) [@livetech](https://forum.mautic.org/u/livetech)\
**Post date:** [September 26, 2020, 9:30am UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/3 "2020-09-26T09:30:31Z")

</div>

already done this tip

when i acess  
[http://mautic.domain/](http://mautic.domain/)  
redirect to  
[http://mautic.domain/s/dashboard](http://mautic.domain/s/dashboard)  
and return 404

---

<div class="post-metadata">

**Author:** ![livetech](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/livetech/32/864_2.png) [@livetech](https://forum.mautic.org/u/livetech)\
**Post date:** [September 26, 2020, 1:07pm UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/4 "2020-09-26T13:07:36Z")

</div>

in version 3.0.2 site\_url contains /index.php?

now return ERR\_TOO\_MANY\_REDIRECTS

---

<div class="post-metadata">

**Author:** ![livetech](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/livetech/32/864_2.png) [@livetech](https://forum.mautic.org/u/livetech)\
**Post date:** [September 26, 2020, 1:30pm UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/5 "2020-09-26T13:30:25Z")

</div>

in database is needed add url in some place

---

<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:** [September 26, 2020, 2:16pm UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/6 "2020-09-26T14:16:15Z")

</div>

Can you plz try this:  
Are you using https?

---

<div class="post-metadata">

**Author:** ![livetech](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/livetech/32/864_2.png) [@livetech](https://forum.mautic.org/u/livetech)\
**Post date:** [September 26, 2020, 2:27pm UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/7 "2020-09-26T14:27:19Z")

</div>

with and without i already tried

---

<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:** [September 26, 2020, 2:29pm UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/8 "2020-09-26T14:29:29Z")

</div>

Okay, what happens if you add this to index.php first line?  
$\_SERVER[‘HTTPS’] = ‘on’;

---

<div class="post-metadata">

**Author:** ![livetech](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/livetech/32/864_2.png) [@livetech](https://forum.mautic.org/u/livetech)\
**Post date:** [September 27, 2020, 3:07pm UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/9 "2020-09-27T15:07:13Z")

</div>

I tried your tip, but not give me success

after comment this in .htaccess  
#RewriteEngine on  
#RewriteCond %{HTTP\_HOST} ^mautic.segredosdoprogramacasaverdeeamarela.com$  
#RewriteRule ^/?$ “http://^(?!/(index\.php|index\_dev\.php|app|addons|plugins|media|upgrade|upgrade\_v3))(/(.\*))$” [R=301,L]

return error  
ERR\_INVALID\_REDIRECT

PS: using https:// in url on local.php

i already tried everything

in database don’t have url like wordpress?

---

<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:** [September 27, 2020, 4:21pm UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/10 "2020-09-27T16:21:51Z")

</div>

Ok. Worth a shot.

The problem is usually like this:

- site url in local.php
- site url in apache
- https/http redir fails
- cache issue (needs rebuild)
- hidden files not moved - causes error

---

<div class="post-metadata">

**Author:** ![livetech](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/livetech/32/864_2.png) [@livetech](https://forum.mautic.org/u/livetech)\
**Post date:** [September 27, 2020, 9:40pm UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/11 "2020-09-27T21:40:48Z")

</div>

i update to 3.1.0 on command line  
php bin/console doctrine:migrations:status

```
 >> Previous Version: Already at first version
    >> Current Version: 0
    >> Next Version: 2018-11-11 09:54:47 (20181111095447)
    >> Latest Version: 2020-08-15 15:37:11 (20200815153711)
    >> Executed Migrations: 0
    >> Executed Unavailable Migrations: 0
    >> Available Migrations: 13
    >> New Migrations: 13
```

---

<div class="post-metadata">

**Author:** ![livetech](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/livetech/32/864_2.png) [@livetech](https://forum.mautic.org/u/livetech)\
**Post date:** [September 27, 2020, 9:59pm UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/12 "2020-09-27T21:59:15Z")

</div>

```
WARNING! You are about to execute a database migration that could result in schema changes and data loss. Are you sure you wish to continue? (y/n)y
Migrating up to 20200815153711 from 20200220172041

  ++ migrating 20200227110431

     -> CREATE INDEX dnc_channel_id_search ON lead_donotcontact (channel_id)
Migration 20200227110431 failed during Execution. Error An exception occurred while executing 'CREATE INDEX dnc_channel_id_search ON lead_donotcontact (channel_id)':

SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'dnc_channel_id_search'

In AbstractMySQLDriver.php line 106:

  An exception occurred while executing 'CREATE INDEX dnc_channel_id_search ON lead_donotcontact (channel_id)':

  SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'dnc_channel_id_search'

In PDOConnection.php line 80:

  SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'dnc_channel_id_search'

In PDOConnection.php line 75:

  SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'dnc_channel_id_search'
```

---

<div class="post-metadata">

**Author:** ![jimkey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jimkey/32/3317_2.png) [@jimkey](https://forum.mautic.org/u/jimkey)\
**Post date:** [September 28, 2020, 2:39am UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/13 "2020-09-28T02:39:13Z")

</div>

I changed my domain in Configuraiton “Site URL”. Are you getting a mautic login prompt? If not then I think it’s the web server. Usually in either Nginx or Apache there is a Server Name field that you should change, too. That’s what I had to changed when I did it.

Restore from backup and try again as your 3.1 upgrade failed.

---

<div class="post-metadata">

**Author:** ![livetech](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/livetech/32/864_2.png) [@livetech](https://forum.mautic.org/u/livetech)\
**Post date:** [September 28, 2020, 5:53am UTC](https://forum.mautic.org/t/mautic-new-domain-error-404/16283/14 "2020-09-28T05:53:46Z")

</div>

restore backup from 3.0.2  
run before migrations  
after upgrade to Mautic 3.1.0

acess site url http and login show, acess admin and change to https (apply and save)

solved now my mautic is back
