How to prevent hotlinking on your Zelune based proxy.

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. ;)

You can show your support by buying me a coffee

Popularity: unranked [?]


How to prevent hotlinking on your CGI based proxy.

Previously I wrote a code about how to prevent hotlinking on your PHProxy. This time around you will learn how to prevent hotlinking on your CGI Proxy script.

Open up your nph-proxy.cgi with notepad or your favorite text editor.
Look for this line.

$HTTP_1_X=  $NOT_RUNNING_AS_NPH   ? ‘Status:’   : “HTTP/$HTTP_VERSION” ;

Below the line, add this line and change the domain with your own.

if($ENV{’HTTP_REFERER’} =~ /^http:\/\/www.yourdomain.com/)
{
}
else
{
&redirect_to(’http://www.targetdomain.com/’, ”);

What it does, whenever people hotlinked your proxy, they will be directed to the address that you specify above.
If you are wanting to get rid of them for good, perhaps shoving them off to my listing site can do you good. lol.

You can show your support by buying me a coffee

Popularity: unranked [?]