Created
March 16, 2012 11:07
-
-
Save bdunogier/2049622 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* PHP version of the rewrite rules that were previously used to enable multi-site in a cluster environnement | |
* | |
* Each site has its own file, based on its vardir subcomponent: var/plain_site/ => config.cluster/plain_site.php. | |
* The cluster rewrite rules send everything to index_cluster.php, for every site. | |
**/ | |
if ( !$siteId = preg_match( "|^/var/([^/]+)/|", $_SERVER['SCRIPT_URL'], $m ) ) | |
// error 404 | |
// exit | |
$configFile = "config.cluster/$siteId.php"; | |
if ( !file_exists( $configFile ) ) | |
// error 404 | |
// exit | |
include $configFile; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment