/*
* Cette page redirige toutes les demandes /page.php?p=X vers /X_name (lui-même géré par URL rewriting)
* Auparavant, l'index s'appelait "page" et non "index"...
La redirection http 301 empêche probablement le browser d'appeler la page...
*/
require "session.php";
//logthis("page.php, ".$_SERVER['HTTP_REFERER'].",".$ip);
$p = v_init("p");
if ($p != ""){
if (!is_numeric($p)){
// Renvoi à la homepage si p n'est pas un nombre
?>
}
} else {
$p = $home;
}
$sql = "SELECT Pag_Name,Pag_Direct
FROM pages
WHERE Pag_ID = :p";
$stmt = $pdo->prepare($sql);
$stmt->execute(array(":p" => $p));
$myrow = $stmt->fetch(PDO::FETCH_ASSOC);
//echo $myrow["Pag_Name"];
// Vérifie si la page existe
if ($myrow["Pag_Name"] == "") {
if ($isLocal){?>
} else {?>
}
} else {
if ($source == "linkcity"){ $source = "www"; }
// Redirection
if ($isLocal){
if ($p == $home){
$url = "Location: http://www.linkcity.test:8888/fr/index.php";
} else {
$url = "Location: http://www.linkcity.test:8888/fr/".$myrow["Pag_Direct"];
}
} else if ($isTest){
if ($p == $home){
if ($isLCFR){
$url = "Location: http://linkcityfrance.netscript.be/fr/index.php";
} else {
$url = "Location: http://www.nihilobstat.be/fr/index.php";
}
} else {
if ($isLCFR){
$url = "Location: http://linkcityfrance.netscript.be/fr/".$myrow["Pag_Direct"];
} else {
$url = "Location: http://www.nihilobstat.be/fr/".$myrow["Pag_Direct"];
}
}
} else if ($isLCFR){
if ($p == $home){
$url = "Location: http://www.linkcity.fr/fr/index.php";
} else {
$url = "Location: http://www.linkcity.fr/fr/".$myrow["Pag_Direct"];
}
} else {
if ($p == $home){
$url = "Location: http://".$source.".linkcity.be/".$lang."/index.php";
} else {
$url = "Location: http://".$source.".linkcity.be/".$lang."/".$myrow["Pag_Direct"];
}
}
//echo ("Will redirect to: ".$url);
header("Status: 301 Moved Permanently", false, 301);
header($url);
exit();
}