Seite 1 von 1
Redirect Script ...
Verfasst: 14.05.2006, 17:36
von ses
Hi,
hat jemand zufällig ein gutes Redirect Script, ähnlich dem hier bei Abakus ala:
https://www.abakus-internet-marketing.d ... ttps://www.
Gruß Sebastian
Re: Redirect Script ...
Verfasst: 17.05.2006, 09:48
von haha
ses hat geschrieben:hat jemand zufällig ein gutes Redirect Script, ähnlich dem hier bei Abakus
Keine Ahnung, ob das "gut" ist, aber es tut zumindest (falls der Server PHP kann):
Code: Alles auswählen
<?php
$z = $_SERVER["QUERY_STRING"];
if (preg_match('/^[a-z]+:\/\/.*\./', $z) == 1) { // URL-Format grob prüfen: Protokoll vorhanden, zweiteilig?
header("HTTP/1.0 301 See over there");
header("Location: " . $z);
echo '<html><head><title>See over there</title></head><body><p>Go to <a href="';
echo htmlspecialchars($z);
echo '">';
echo htmlspecialchars($z);
echo '</a>.</p></body></html>';
}
else {
header("400 Unacceptable URL parameter");
?><html><head><title>Unacceptable URL parameter</title>
<body>
<h1>Unacceptable URL parameter</h1>
<p>The parameter <q><?php echo htmlspecialchars($z); ?></q> doesn't seem to me like an acceptable address to send you to. Sorry & hugs.</p>
</body></html>
<?php
}
?>