diff --git a/index.php b/index.php index 218f31300ed5f6e3bf00c4051e222583619012c3..1622627ea4eab3632858c5b27f5ebeefec5c77b0 100644 --- a/index.php +++ b/index.php @@ -10,16 +10,17 @@ if(isset($_SERVER['HTTPS'])) $http = "https"; else $http = "http"; // Variables permettant la gestion des pages à afficher $url = parse_url("$http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); +$urlPath = explode("/", $url["path"]); +array_shift($urlPath); + // Si l'url commence par /Cristo -> Dev de Mathieu if(substr($_SERVER["REQUEST_URI"], 0, 7) == "/Cristo"){ $websiteBaseUrl = $http."://".$_SERVER["HTTP_HOST"]."/Cristo"; + array_shift($urlPath); } else { $websiteBaseUrl = $http."://".$_SERVER["HTTP_HOST"]; } -$urlPath = explode("/", $url["path"]); -array_shift($urlPath); - if(!empty($urlPath[0])){ match ($urlPath[0]) { "rechercher" => require_once('pages/rechercher.php'),