Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.electricien-77.com
/
htdocs
/
config
/
/srv/data/web/vhosts/www.electricien-77.com/htdocs/config/router.php
<?php $slug = str_replace(str_replace('index.php', '', $_SERVER['SCRIPT_NAME']),'',$_SERVER['REQUEST_URI']); $base = 'https://'. $_SERVER['HTTP_HOST'] . str_replace('index.php', '', $_SERVER['SCRIPT_NAME']); //echo $_SERVER['HTTP_HOST']." ==> ".$slug." | base = ".$base;die; include "routes.php"; $current_route = array_search($slug,$routes); if(strpos($slug,'/?')!==false){ $slug = str_replace('/?', '?', $slug); } if(!$current_route){ if (empty($slug)){//Home page est vide mais le routeur contient la baseref $current_route = "home"; }elseif (strpos($slug,$routes['album'].'-')!==false){//Actualité simple $current_route = "album"; }elseif (strpos($slug,$routes['product'].'-')!==false){//Produit simple $current_route = "product"; }elseif (strpos($slug,'?')!==false){ $str = explode("?", $slug); if(!empty($str[0])){ header("Location: " . $routes[$str[0]]); }else{ if (empty($current_route)){ header("Location: " . $routes['home']); } } }else{ //http_response_code(404);//Change le code de la page $current_route = 404;//Charge la page 404 } } if($conf_client_database){ $page = "pages/db/".$current_route.".php"; } else{ $page = "pages/".$current_route.".php"; } $conf_title=$metas[$current_route][0]; $conf_description=$metas[$current_route][1]; $conf_keywords=$metas[$current_route][2];