# Changing site\_url creates 500 error

**URL:** <https://forum.mautic.org/t/changing-site-url-creates-500-error/17116>\
**Category:** Product Support\
**Created:** [November 23, 2020, 7:09pm UTC](https://forum.mautic.org/t/changing-site-url-creates-500-error/17116 "2020-11-23T19:09:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexhammer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexhammer/32/14525_2.png) [@alexhammer](https://forum.mautic.org/u/alexhammer)\
**Post date:** [November 23, 2020, 7:09pm UTC](https://forum.mautic.org/t/changing-site-url-creates-500-error/17116/1 "2020-11-23T19:09:30Z")

</div>

**Your software**  
My Mautic version is: 3.1.2  
My PHP version is: 7.3  
My Database type and version is: MariaDB 10.4

**Your problem**  
My problem is:  
I moved Mautic from shared hosting to VPS. Everything works as it should be. Now I wanted to change the site\_url from [https://subdomain/domain.tld](https://subdomain/domain.tld) to [https://subdomain/domain.tld/maut](https://subdomain/domain.tld/maut)

a) If I do this in the configuration panel it gives me a 500 error and doesn’t save to local.php file.

b) If I change it directly in the local.php file, delete the cache and give owner and write permissions it saves everything but I get a 404 error when I try to access the dashboard or contacts or anything else.

The odd thing is I can get into the dashboard without the /maut/ extension.

My guess is, something doesn’t get configured correctly when the cache gets rebuilt.

These errors are showing in the log:  
none (!)

---

<div class="post-metadata">

**Author:** ![allistaire](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/allistaire/32/637_2.png) [@allistaire](https://forum.mautic.org/u/allistaire)\
**Post date:** [November 23, 2020, 7:48pm UTC](https://forum.mautic.org/t/changing-site-url-creates-500-error/17116/2 "2020-11-23T19:48:39Z")

</div>

Hey there,

I’m not a total pro on this, but have you tried changing this via sftp? In Filezilla, I am able to control how the url reads by changing the directory structure. Essentially, make sure your mautic install folder is named “maut” then add that entire folder into the “domain.tld”. That should do the trick without causing any 500 errors.

---

<div class="post-metadata">

**Author:** ![alexhammer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexhammer/32/14525_2.png) [@alexhammer](https://forum.mautic.org/u/alexhammer)\
**Post date:** [November 24, 2020, 7:06am UTC](https://forum.mautic.org/t/changing-site-url-creates-500-error/17116/3 "2020-11-24T07:06:08Z")

</div>

Yes. Mautic is installed in the maut folder.  
Do you mean I should add the /maut directory to the virtual host file? Like append it to server name?

---

<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:** [November 24, 2020, 11:17am UTC](https://forum.mautic.org/t/changing-site-url-creates-500-error/17116/4 "2020-11-24T11:17:34Z")

</div>

Alex, are you getting a Mautic 404? Or just any 404?

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [November 24, 2020, 2:02pm UTC](https://forum.mautic.org/t/changing-site-url-creates-500-error/17116/5 "2020-11-24T14:02:30Z")

</div>

Update the URLs in the local.php file to your new installation and you should be good to go.

---

<div class="post-metadata">

**Author:** ![allistaire](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/allistaire/32/637_2.png) [@allistaire](https://forum.mautic.org/u/allistaire)\
**Post date:** [November 24, 2020, 8:06pm UTC](https://forum.mautic.org/t/changing-site-url-creates-500-error/17116/6 "2020-11-24T20:06:48Z")

</div>

Yep, you could do that, or change it in the local.php as @EJL mentioned.

---

<div class="post-metadata">

**Author:** ![alexhammer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexhammer/32/14525_2.png) [@alexhammer](https://forum.mautic.org/u/alexhammer)\
**Post date:** [November 27, 2020, 9:21pm UTC](https://forum.mautic.org/t/changing-site-url-creates-500-error/17116/7 "2020-11-27T21:21:53Z")

</div>

@joeyk I got a Mautic 404.  
@EJL yes I did this already. It didn’t work anyway. ☹  
@allistaire thanks.

Finally we just changed all the links via sql in all 700+ existing emails, in all pages, images and so on.  
And then changed the tracking code on all 4 pages which are filling this Mautic instance.  
That took us approx. 5 minutes.  
I think it is better futurewise.

Thanks for your suggestions and your help guys 🙌
