Page 1 of 1

Multiple sites on one dev box

Posted: Mon Feb 02, 2004 1:06 pm
by nacer
I'm developing more than one web site on the same dev box. I've put each site into it's own subfolder. When I go to upload one of them to it's live server, all my include's must be changed to reflect the base url of the live server. In other words, I have to delete the subfolder name from everything. Is there a neat trick to get around going in and re-coding all my includes and web addresses to reflect the main server?

Posted: Wed Feb 04, 2004 11:34 pm
by mikusan
Make a "config.php" where you declare the following variable:
$CFG['site_dir'] = '/var/www/whatever';

Then, in every file, include the config.php file, working on the assumption that it is in the same directory, or if necessary add /../../

This means you only have to change the variable once.