Quote from: AMDbuilder at May 20, 2008, 11:13 AMAs for the multi sites it will be two sites with one manager/database. I’m not sure if I would need to point the domains all to the same folder or one folder for the main site and one for the second site. At the moment I am looking for the kiss method once the first beta comes out then I will start looking into a central core and manager install with separate DB/file for the other sites.
As of revision 3722 this morning, you have a choice when sharing a single database and manager across multiple domains. You can choose to use the primary front-end context (known as ’web’) to handle all domains or you can create a unique gateway file for each domain to directly initialize a specific context. If you use a single gateway, you would use a plugin to switch contexts (the changes in revision 3722 make this plugin possible), something like so:
<?php
switch ($modx->config['http_host']) {
case 'domain2.tld:80':
case 'domain2.tld':
// if the http_host is of a specific domain, switch the context
$modx->switchContext('domain2.tld');
break;
default:
// by default, don't do anything
break;
}
?>
Alternatively, you would simply copy the index.php file from the default web context (along with the core.config.php and .htaccess for rewrite rules altered appropriately) to another directory and change the line
$modx->initialize('web'); to
$modx->initialize('aContextNameOfYourChoice'); I will be working on a tool in the reference manager interface that will allow deployment of a new context gateway without manual intervention (assuming you have the proper permissions to have the PHP process write files/folders in the locations you want to deploy to).
Note that you could also just copy the index.php in the same directory and rename it to do this, but your rewrite rules would have to be smart enough to route requests to the appropriate context gateway.
You can also still use a custom core location in either of these scenarios; this is independent of the context-driven multi-site capabilities.