How to prevent hotlinking on your Zelune based proxy. Written on January 20, 2009, by admin.
Oh, this is a continuation from the hotlinking code for CGI proxy yesterday. Like PHProxy, Glype and CGI proxy, Zelune also been considered as a popular proxy script. Thus, it also has the disadvantages of being hotlinked by other good-for-nothing webmasters. So, to prevent hotlinking on Zelune, simply open up your index.php and look for php opening tag ( Right after the tag, insert this codes.
// Change this to your domain (no ‘www.’)
$domain=”yourdomain.com”;// If no request:
if($_GET[’__new_url’]!=””){
// Get referer
$referer=$_SERVER[”HTTP_REFERER”];
// Check to see if referer is not the proxys domain
$count=substr_count($referer,$domain);
// If there is an outside referer:
if($count==0){
// If there is a request:
if($_GET[’__new_url’]!=””){
// Redirect to homepage and finish script
header(”Location: http://www.” . $domain . “/”);
exit();
}
}
}
See? A simple solution to saves you lots of bandwidth. 😉
These post might interest you
Leave a Comment
If you would like to make a comment, please fill out the form below.