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

Verfasst:
von

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&#91;"QUERY_STRING"&#93;;
if &#40;preg_match&#40;'/^&#91;a-z&#93;+&#58;\/\/.*\./', $z&#41; == 1&#41; &#123; // URL-Format grob prüfen&#58; Protokoll vorhanden, zweiteilig?
    header&#40;"HTTP/1.0 301 See over there"&#41;;
    header&#40;"Location&#58; " . $z&#41;;
    echo '<html><head><title>See over there</title></head><body><p>Go to <a href="';
    echo htmlspecialchars&#40;$z&#41;;
    echo '">';
    echo htmlspecialchars&#40;$z&#41;;
    echo '</a>.</p></body></html>';
&#125;
else &#123;
    header&#40;"400 Unacceptable URL parameter"&#41;;
?><html><head><title>Unacceptable URL parameter</title>
<body>
<h1>Unacceptable URL parameter</h1>
<p>The parameter <q><?php echo htmlspecialchars&#40;$z&#41;; ?></q> doesn't seem to me like an acceptable address to send you to. Sorry & hugs.</p>
</body></html>
<?php
&#125;
?>