[eluser]John_Betong[/eluser]
Hi All,
On one of my sites I have three separate URL's all with the same DNN that share a single Ci_System folder.
I set the index.php to recognise the URL and jump to the relevant folder. I should imagine the same thing could be achieved by using a .htaccess file?
index.php
Code:
switch ($_SERVER['SERVER_NAME']) {
case 'localhost' :
$application_folder = 'system/application'; // ncgecom
$application_folder = "plaroma-web-vhost";
$application_folder = 'ci_fred';
$application_folder = 'ci_jokes';
$application_folder = 'ci_betsprint';
$application_folder = 'ci_rentaroofbox';
break;
case 'anetizer.com' :
case 'www.anetizer.com' : $application_folder = 'ci_jokes';
break;
case 'betsprint.com' :
case 'www.betsprint.com' : $application_folder = 'ci_betsprint';
break;
case 'justjoolz.com' :
case 'www.justjoolz.com' : $application_folder = 'ci_jokes';
break;
case 'johns-jokes.com' :
case 'www.johns-jokes.com': $application_folder = 'ci_jokes'; break;
break;
default : // $application_folder = 'ci_rentaroofbox'; break;
} // end switch
This setup allows having a single set of files that work both for localhost and online. (Similar switch statement for the database.php configuarion).
Currently on my localhost I have to manually select the correct switch statement in the index.php file...
...BUT I have just been introduced to subdomains. I have still not come to terms with the best way of handling numerous sites using this setup - any advice?
Cheers,
John_Betong