Hello,
I am having difficulty making modx and apache play nice I think. I am setting up a sub domain context. I am using the "Sub domain via folder" method:
http://rtfm.modx.com/display/revolution20/Creating+a+Subdomain+from+a+Folder+using+Virtual+Hosts
my root index.php file:
switch ($modx->getOption('http_host')) {
case 'm.mysite.com':
case 'm.mysite.com':
// if the http_host is of a specific domain, switch the context
$modx->switchContext('mobile');
break;
default:
// fallback, go to main context
$modx->initialize('web');
break;
}
my "/mobile" index.php file:
$modx->initialize('mobile');
my "/mobile/config.core.php" file:
define('MODX_CORE_PATH', '/Applications/MAMP/htdocs/mysite/trunk/core/');
define('MODX_CONFIG_KEY', 'config');
I have set up the site_start and other required settings within the context as stated in the rtfm.
My trouble:
http://local.mysite.com/mobile works great.
http://m.mysite.com fails to render. It just loads and loads and loads.
If I update my root index.php file to this:
switch ($modx->getOption('http_host')) {
case 'm.mysite.com':
case 'm.mysite.com':
// if the http_host is of a specific domain, switch the context
$modx->switchContext('mobile');
break;
default:
// fallback, go to main context
$modx->initialize('mobile');
break;
}
So that everything points to the mobile context, it works. So there is something that I just haven’t connected yet but am failing to see just what it is.
This is what my httpd.conf file looks like:
<VirtualHost *:80>
ServerName local.mysite.com
DocumentRoot /Applications/MAMP/htdocs/mysite/trunk
</VirtualHost>
<VirtualHost *:80>
ServerName m.mysite.com
DocumentRoot /Applications/MAMP/htdocs/mysite/trunk/mobile
</VirtualHost>
I am using Revolution 2.0.8