Changing site_url creates 500 error

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 to 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 (!)

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.

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?

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

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

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

@joeyk I got a Mautic 404.
@EJL yes I did this already. It didn’t work anyway. :frowning:
@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 :raised_hands:

1 Like