Here is a workaround that someone else came up with to achieve this. Not sure of the ramifications, but the code may or may not help.
settings.php
<?php
//add folders in which the subsites reside to this array
$sites = array(
'museum1',
'museum2',
'museum3',
);
$request = explode('/', trim($_SERVER['REQUEST_URI'], '/'));
if(sizeof($request) && preg_match('/^'.implode('|', $sites).'$/i', $request[0], $matches)) {
// set the appropriate HTTP_HOST to trick Domain Access
$site = $matches[0];
$_SERVER['ORIGINAL_HTTP_HOST'] = $_SERVER['HTTP_HOST'];
$_SERVER['HTTP_HOST'] = $site.'.'.$_SERVER['HTTP_HOST'];
//rebuild the Q
if(!empty($_GET['q'])) {
$q = implode('/', $request);
if(($pos = strpos($q, '?')) !== FALSE) {
$q = substr($q, 0, $pos);
}
$size = strlen($site);
$_GET['q'] = ltrim(substr($q, $size), '/');
$HTTP_GET_VARS['q'] = $q;
}
//used to set the correct $base_url in settings.php
global $da_site;
$da_site = $site;
}
?>
Comments
Comment #1
agentrickardLooks server-specific (Apache) and like part is missing. What is $da_site later used for?
Also required hard-coding some rules, and looks pretty brittle. Let's try to avoid this approach.