Hey all, Well we all know how much of a problem hotlinking can be. With proxy sites it's even worse! This mod prevents hotlinking in all cases, saving you tonnes of bandwidth, and helping prevent illegal material viewing at the same time. Description: The MOD checks firstly to see if only an object is being proxied (i.e. image, swf etc), if this is the case, it will check to see if the referer is from outside your website, if so, it will simply redirect to a page of your choice (homepage by default). And tada! That's it, this will prevent ANYTHING from being hotlinked through your proxy. Version: 1.1 Installation: Simply copy and paste the mod code into your index.php page, just below the '<?php' at the top of the page. /* PHProxy bandwidth MOD 1.1 by Rhett Canney (Billy Connite) This MOD will stop any hotlinking via PHProxy, even if the clients referer is not set! Check out proxywebsite.org if you want to try hotlinking. */ // allow hotlinking from these sites, seperate by comma (make sure you eneter your site's domains) $domains="www.yourdomain.com,yourdomain.com"; // convert domains into an array $domains=explode(",",$domains); // if there is a request: if($_GET['q']!="") { // get referer $referer=explode("/",($_SERVER['HTTP_REFERER'])); // if the referer is not allowed: if(!in_array($referer[2],$domains)) { // redirect to homepage and finish script header("Location: http://".$domains[0]."/"); exit(); } } /* END MOD */ PHP: All the credit goes to BillieCOnnite at NamePros, for the original Thread go here: http://www.namepros.com/free-resour...te-owners-look-here.html?highlight=hotlinking
thanks, already got it saved somewhere, not using it yet though, need to even out my stats then ill implement this. Overall its a good script everyone should consider implementing into their proxy sites