Link to a sample
Link to another sample
What is this?
It is a system that allows for multiple databases to use the same set of files.
How does it work?
Apache runs the following command at startup:
Code: Select all
AliasMatch /free/[^/]+/(.*) "XXXXXXX/htdocs/free_host/$1"When you visit [site]/free/[something]/, you are internally redirected to [site]/free_host/, while the address stays the same.
In my site's configuration file (config.php), I do the following:
Code: Select all
$prepa = substr($_SERVER['PHP_SELF'],6);
$prepb = substr($prepa,0,0 - strlen(stristr($prepa,'/')));
$conf_database = "free_" . $prepb;The end result is that I can host multiple sites using the same set of files, but running off of different databases (all with the same prefix, for easy-of-use on the administration part)
Now, it's not finished yet. There are tons of things that need to be added (adding new sites, using a foreground image for a header defined in the sql database, things like that), but I just want to get some opinions on the overall idea of it.
Note: This is not about the CMS used, but rather the multi-hosting. Keep that in mind.
EDIT: This really didn't fit anywhere else, as it's the Apache set-up and final outcome that matter