<?php
/* don't execute if in the Manager */
if ($modx->context->get('key') == 'mgr') {
return;
}
switch ($_SERVER['HTTP_HOST']) {
case 'domain2.tld':
// if the http_host is of a specific domain, switch the context
$modx->switchContext('domain2.tld');
break;
case 'domain3.tld':
// if the http_host is of a specific domain, switch the context
$modx->switchContext('domain3.tld');
break;
default:
// by default, don't do anything
break;
}
?>