Created
January 22, 2012 08:22
-
-
Save camt/1656247 to your computer and use it in GitHub Desktop.
External redirects from your site trigger web-bots in different ways. If you want to hide them from the web-bots, and have all links on you site point internally, this script is a simple way to do so. You can either run it through a database, which makes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(isset($_REQUEST['rd'])) { | |
$new = $_REQUEST['rd']; | |
// DB access | |
include("db.php"); | |
$sql = "SELECT rdURL FROM rd WHERE rdName='".$new." LIMIT 1';"; | |
$result = mysql_query($sql); | |
mysql_close($conn); | |
if($result) { | |
$row = mysql_fetch_array($result); | |
$newURL = $row['rdURL']; | |
header("Location: $newURL"); | |
} | |
else { | |
header("Location: home.php"); | |
} | |
} | |
header("Location: home.php"); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment