# Converting from subfolder to sub-domain

**URL:** <https://forum.mautic.org/t/converting-from-subfolder-to-sub-domain/8883>\
**Category:** Product Support\
**Created:** [July 5, 2017, 9:53am UTC](https://forum.mautic.org/t/converting-from-subfolder-to-sub-domain/8883 "2017-07-05T09:53:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![malcolm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/malcolm/32/39_2.png) [@malcolm](https://forum.mautic.org/u/malcolm)\
**Post date:** [July 5, 2017, 9:53am UTC](https://forum.mautic.org/t/converting-from-subfolder-to-sub-domain/8883/1 "2017-07-05T09:53:11Z")

</div>

I’ve experienced several problems which always seem to get related back to the fact that I’m using mautic in a subfolder, ie.  
  
  
  
[https://www.mydomain.com/ma](https://www.mydomain.com/ma)  
  
  
  
so I decided to convert over to using a sub-domain, ie.  
  
  
  
[http://ma.mydomain.com](http://ma.mydomain.com)  
  
  
  
I’ve setup the sub-domain, deleted the cache, and can actually access the dashboard using the new domain. However, forms don’t work and trying to edit the configuration in the app just times out (the line across the top of the page animates for awhile then just stops with no page change).  
  
  
  
Given I can’t edit the config through the app, I eventually found where I think it is stored: app/config/local.php  
  
  
  
So I edited the site\_url value in there to be [http://ma.mydomain.com](http://ma.mydomain.com). I then cleared the cache again, but now when trying to access the dashboard using [http://ma.mydomain.com](http://ma.mydomain.com) I get an error page. the error\_log contains:  
  
  
  
[05-Jul-2017 10:36:04 UTC] PHP Warning: require(/home/mgroves/public\_html/mydomain.com/ma/app/cache/prod/doctrine/orm/Proxies/\_\_CG\_\_MauticPluginBundleEntityPlugin.php): failed to open stream: No such file or directory in /home/mgroves/public\_html/mydomain.com/ma/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209  
  
[05-Jul-2017 10:36:04 UTC] PHP Fatal error: require(): Failed opening required ‘/home/mgroves/public\_html/mydomain.com/ma/app/cache/prod/doctrine/orm/Proxies/\_\_CG\_\_MauticPluginBundleEntityPlugin.php’ (include\_path=’.:/opt/cpanel/ea-php56/root/usr/share/pear’) in /home/mgroves/public\_html/mydomain.com/ma/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209  
  
  
  
  
  
It is correct in that those files (in fact, the whole doctrine folder) are not in the cache when it is regenerated with site\_url set to a subdomain, while they are there when the cache is regenerated with site\_url set to a subfolder.  
  
  
  
So, I guess my questions is either:

- what are the steps to convert a working subfolder install into a working subdomain install  
  
or  
- how do I trigger a regeneration of the app/cache/doctrine folder once I’ve changed to a subdomain.  
  
  
  
Cheers  
  
Malcolm

---

<div class="post-metadata">

**Author:** ![malcolm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/malcolm/32/39_2.png) [@malcolm](https://forum.mautic.org/u/malcolm)\
**Post date:** [July 5, 2017, 9:53am UTC](https://forum.mautic.org/t/converting-from-subfolder-to-sub-domain/8883/2 "2017-07-05T09:53:11Z")

</div>

I’ve experienced several problems which always seem to get related back to the fact that I’m using mautic in a subfolder, ie.

[https://www.mydomain.com/ma](https://www.mydomain.com/ma)

so I decided to convert over to using a sub-domain, ie.

[http://ma.mydomain.com](http://ma.mydomain.com)

I’ve setup the sub-domain, deleted the cache, and can actually access the dashboard using the new domain. However, forms don’t work and trying to edit the configuration in the app just times out (the line across the top of the page animates for awhile then just stops with no page change).

Given I can’t edit the config through the app, I eventually found where I think it is stored: app/config/local.php

So I edited the site\_url value in there to be [http://ma.mydomain.com](http://ma.mydomain.com). I then cleared the cache again, but now when trying to access the dashboard using [http://ma.mydomain.com](http://ma.mydomain.com) I get an error page. the error\_log contains:

[05-Jul-2017 10:36:04 UTC] PHP Warning: require(/home/mgroves/public\_html/mydomain.com/ma/app/cache/prod/doctrine/orm/Proxies/\_\_CG\_\_MauticPluginBundleEntityPlugin.php): failed to open stream: No such file or directory in /home/mgroves/public\_html/mydomain.com/ma/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209  
[05-Jul-2017 10:36:04 UTC] PHP Fatal error: require(): Failed opening required ‘/home/mgroves/public\_html/mydomain.com/ma/app/cache/prod/doctrine/orm/Proxies/\_\_CG\_\_MauticPluginBundleEntityPlugin.php’ (include\_path=’.:/opt/cpanel/ea-php56/root/usr/share/pear’) in /home/mgroves/public\_html/mydomain.com/ma/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209

It is correct in that those files (in fact, the whole doctrine folder) are not in the cache when it is regenerated with site\_url set to a subdomain, while they are there when the cache is regenerated with site\_url set to a subfolder.

So, I guess my questions is either:

- what are the steps to convert a working subfolder install into a working subdomain install  
or
- how do I trigger a regeneration of the app/cache/doctrine folder once I’ve changed to a subdomain.

Cheers  
Malcolm

---

<div class="post-metadata">

**Author:** ![ninjoan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ninjoan/32/1005_2.png) [@ninjoan](https://forum.mautic.org/u/ninjoan)\
**Post date:** [July 5, 2017, 12:14pm UTC](https://forum.mautic.org/t/converting-from-subfolder-to-sub-domain/8883/3 "2017-07-05T12:14:44Z")

</div>

Go to  
[https://your-mautic-installation-domain.com/s/config/edit](https://your-mautic-installation-domain.com/s/config/edit)

General Settings \> Site URL  
[http://ma.mydomain.com](http://ma.mydomain.com)

Save & Close  
Then rebuild the forms.

---

<div class="post-metadata">

**Author:** ![malcolm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/malcolm/32/39_2.png) [@malcolm](https://forum.mautic.org/u/malcolm)\
**Post date:** [July 5, 2017, 10:07pm UTC](https://forum.mautic.org/t/converting-from-subfolder-to-sub-domain/8883/4 "2017-07-05T22:07:29Z")

</div>

Thanks for the help, but unfortunately that hasn’t got me much further.

> Go to [https://your-mautic-installation-domain.com/s/config/edit](https://your-mautic-installation-domain.com/s/config/edit)  
> General Settings \> Site URL [http://ma.mydomain.com](http://ma.mydomain.com)

If I try and change the SiteURL via the config page, when I save I get the following error: “The CSRF token is invalid. Please try to resubmit the form.” When I check the config/local.php file, the change to the SiteURL has not been saved.

However, you got me a bit further. I changed it directly in config/local.php, deleted the cache directory, then hit [http://ma.mydomain.com](http://ma.mydomain.com) which brought up the dashboard. I could then get to the Forms page and batch rebuild all the forms. This successfully added the doctrine folder to the cache.

Still can’t edit the config in the browser (times out as per my original post) and even after altering the URL in the wordpress mautic plugin, forms don’t appear in pages.

Starting to think I might just have to do a full, clean install in a subdomain and migrate all my forms, contacts, campaigns, etc across. I hope there’s an export/import 🙂
