Created
January 22, 2014 09:52
-
-
Save mkay/8556130 to your computer and use it in GitHub Desktop.
Example switch for handling multiple websites with MODX. In your /index.php: search & replace (+/- line 68)... $modx->initialize('web'); ...with this gist:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $modx->initialize('web'); | |
switch(strtolower(MODX_HTTP_HOST)) { | |
case 'www.example.com:80': | |
case 'www.example.com': | |
$modx->initialize('my-example-context'); // context for example.com | |
break; | |
case 'www.example2.com:80': | |
case 'www.example2.com': | |
$modx->initialize('my-example2-context'); // context for example2.com | |
break; | |
default: | |
$modx->initialize('web'); // default context | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment