Skip to content

Instantly share code, notes, and snippets.

@rtripault
Created April 16, 2011 17:42
Show Gist options
  • Save rtripault/923332 to your computer and use it in GitHub Desktop.
Save rtripault/923332 to your computer and use it in GitHub Desktop.
Initialize contexts based on http hosts (MODX Revolution) - source: http://modxcms.com/forums/index.php/topic,63406.msg359673.html#msg359673
switch(strtolower(MODX_HTTP_HOST)) {
case 'dns.tld1:80':
case 'dns.tld1':
$modx->initialize('ctx1');
break;
case 'dns.tld2:443':
case 'dns.tld2:80':
case 'dns.tld2':
$modx->initialize('ctx2');
break;
default:
$modx->initialize('web');
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment