From 729adbf17b5a612e417533c5bc1b3bcd77e0f62e Mon Sep 17 00:00:00 2001
From: Sofiane Lasri <alasri250@gmail.com>
Date: Mon, 15 May 2023 16:44:27 +0200
Subject: [PATCH] Hotfix for mahtieu

---
 index.php | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/index.php b/index.php
index 218f313..1622627 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'),
-- 
GitLab