$host = $_SERVER['HTTP_HOST'];
$f = file('/home/cheval-shop/public_html/redirs/list-redirs');
foreach ($f as $l) {
$l = trim($l);
$spl = explode("|",$l);
if ($spl[0] == $host) {
$redir = explode('/',$spl[1]);
if ($spl[2] == "frames") {
?>
} elseif ($spl[2] == "301") {
header("Status: 301 Moved Permanently", false, 301);
header("Location: ".rtrim($spl[1],'/').$_SERVER["REDIRECT_URL"]);
} elseif ($spl[2] == "302") {
header("Location: ".$spl[1].$_SERVER["REDIRECT_URL"]);
}
}
}
?>