How to prevent hotlinking on your CGI based proxy. Written on January 19, 2009, by admin.
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.
These post might interest you
Leave a Comment
If you would like to make a comment, please fill out the form below.