Hi all, I’m struggling to get context switching working, I’ve been working from the following links:
http://rtfm.modx.com/display/revolution20/Using+One+Gateway+Plugin+to+Manage+Multiple+Domains
http://www.belafontecode.com/modx-revolution-hosting-multiple-domains/
It just doesn’t seem to have any effect, no errors, nothing.
I’ve added this code to the root index.php file.
switch ($modx->getOption('http_host')) {
case 'domain2.co.uk:80':
case 'domain2.co.uk':
// if the http_host is of a specific domain, switch the context
$modx->switchContext('domain2');
break;
default:
// fallback, go to main context
$modx->initialize('web');
break;
}
I’ve created my domain2 context and added all the settings: site_start, base_url, http_host and site_url. I’ve checked these details over and over. When I enter the 2nd domain it just functions as a parked domain and points to my primary domain. Also I can’t preview the resource I created in my new context.
My second domain is parked rather than an addon domain, does this matter?
Just noticed ’Virtual Directory Support’ is disabled, could that be anything?
I’m out of ideas now, help much appreciated as always, Ta
MODx Revolution 2.0.8-pl (traditional), Using FURLS, parked domain, PHP 5.2.14