|
Hotlinking Punishment
Some nice code from a good friend of mine.
.htaccess:
RewriteEngine on
RewriteRule ^(.*)\.gif$ /punisher.php?file=$1.gif [L]
punisher.php:
?
$localsite = "yoursitename.com";
$ref = getenv("HTTP_REFERER");
if ($ref != "" & !preg_match("/$localsite/i", $ref)) {
header("HTTP/1.0 302");
header("Location: $ref");
}
else {
/* This doesn't work for some reason */
header("Content-Type: image/gif");
@readfile("$file");
}
?>
What this will do is automatically img src a hotlinkers entire site. Obviously you need to add < before the first ? mark
Enjoy..
|