Page 1 of 1

sub domains with sub pages

Posted: Wed Jun 23, 2010 8:16 am
by buzzby
hi

i was wondering if there is any way at this point in time to have sub domains with sub pages? so far from what i have found it will be a little tricky. not sure if new incarnations of the cms has already dealt with this. what i would like is to have more than 2 subdomains with each subdomain having sub pages. so it would look like http://subdomain3.mainsite.com/page2.php

is this possible? can it be done currently?

any help on this will be great

cheers
D

Re: sub domains with sub pages

Posted: Wed Jun 23, 2010 10:33 am
by Peciura
Have a look here http://forum.cmsmadesimple.org/index.ph ... 890.0.html

I have only one page that works with 3 domain alias with customized '/config.php'. I am using ugly urls.
Basic mod could look like this
switch ($_SERVER['HTTP_HOST']){
case 'test2.domain1.lt':
case 'www.test2.domain1.lt':
case 'test.domain1.lt':
case 'www.test.domain1.lt':
case 'domain1.lt':{                    /* some domain aliases */
$config['root_url'] = 'http://'.$_SERVER['HTTP_HOST'];
break;
}
default:{                    /* default domain name */
$config['root_url'] = 'http://www.domain1.lt';
break;
}
}

$config['root_path'] = dirname(__FILE__);

$config['admin_dir'] = 'admin';

$config['previews_path'] = $config['root_path'].'/tmp/cache';

$config['uploads_path'] = $config['root_path'].'/uploads';

$config['uploads_url'] = $config['root_url'] . '/uploads';
In addition You could add different DB credentials and/or paths for each domain.
switch ($_SERVER['HTTP_HOST']){
case 'test2.domain1.lt':
case 'www.test2.domain1.lt':
case 'test.domain1.lt':
case 'www.test.domain1.lt':
case 'domain1.lt':{                  /* specific DB for some domains; Can be specified for each domain */
$config['root_url'] = 'http://'.$_SERVER['HTTP_HOST'];
$config['db_username'] = 'username2';
$config['db_password'] = '#########2';
$config['db_name'] = 'test_username2';
break;
}
default:{                  /* default DB for default domain */
$config['root_url'] = 'http://www.domain1.lt';
$config['db_username'] = 'username1';
$config['db_password'] = '#########1';
$config['db_name'] = 'test_username1';
break;
}
}

Re: sub domains with sub pages

Posted: Wed Jun 23, 2010 1:13 pm
by calguy1000
Buzzby:  Please PAY ATTENTION and follow forum rules when posting.

Also.  CMSMS does not, and will not in any way support multiple domain installs.