Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
trash
/
vhost_www.sanimoderne.fr_1511970463
/
htdocs
/
config
/
//srv/data/trash/vhost_www.sanimoderne.fr_1511970463/htdocs/config/router.php
<?php $slug = str_replace(str_replace('index.php', '', $_SERVER['SCRIPT_NAME']),'',$_SERVER['REQUEST_URI']); $base = 'http://'. $_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); //var_dump($current_route); echo "slug $slug / route $current_route<br>"; if(!$current_route){ if (empty($slug))//Home page est vide mais le routeur contient la baseref $current_route = "home"; elseif (strpos($slug,$routes['news'].'-')!==false)//Pagination actualités $current_route = "news"; elseif (strpos($slug,$routes['news-single'].'-')!==false)//Actualité simple $current_route = "news-single"; elseif (strpos($slug,$routes['album'].'-')!==false)//Actualité simple $current_route = "album"; elseif (strpos($slug,$routes['product'].'-')!==false)//Produit simple $current_route = "product"; 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];