$domain = utf8_decode(idn_to_utf8($_SERVER["HTTP_HOST"]));
#error_log($domain);
include("database.php");
$result = mysqli_query($link, "SELECT destination, delay FROM wwwumleitungen WHERE source = '".$domain."'");
$anzahl=mysqli_num_rows($result);
if ($anzahl>0) {
$row = mysqli_fetch_array($result);
if ($row[1]==0) {
#error_log($domain.":".$row[0],0);
header("Location: ".$row[0],FALSE,"301");
die;
} else {
echo "\n";
echo "
\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "Diese Seite hat eine neue Adresse.
\n";
echo "Bitte benutzen Sie zukünftig die Adresse ".$row[0]."
\n";
echo "Sie werden in ".$row[1]." Sekunden automatisch zur neuen Adresse umgeleitet. Sollten Sie nicht weiterleitet werden, klicken Sie bitte auf den oben genannten Link mit der neuen Adresse.
\n";
echo "
\n";
echo "This page has got a new address.
\n";
echo "Please only use the new address ".$row[0]."
\n";
echo "You will be redirected to the new address in ".$row[1]." seconds. If you won't be redirected please click the link with the new address above.
\n";
echo "
\n";
echo "\n";
echo "\n";
}
} else {
#error_log("Direkt in Pool");
require("index-pool.php");
}
?>