I’m testing out two domains hosted on a single Cpanel account.
Both domains are resolving to the home page and I am using the context switcher Plug-In approach to do this.
Looks something like this:
<?php
switch ($modx->getOption('http_host')) {
case 'www.domain2.com':
$modx->switchContext('www.domain2.com');
break;
default:
$modx->switchContext('web');
break;
}
On each context I have settings that define site_url, base_url, site_name, site_start, and http_host.
Now for the problem...every time I clear the site cache and then try to access the 2nd domain I get a 404 error.
This persists until inside the manager I click on any resource that is assigned to the 2nd domain context. As soon as I do that, the site starts resolving again.
I first saw this in my dev environment and wanted to get it to a production site to test. It also happens in the production environment.
Very odd...any ideas what could be happening here?
Thanks,
-Brian