hey there, i need help from someone who knows how phpproxy works and can answer the question bellow. i am using phpproxy and i have a problem with users stealing my bandwith trough hotlinking. i searched a bit and found the code bellow that where to be pasted in into my index.php files right after <?php but when i do this and upload the file my page blanks out and wont load when i go to it anymore, and once i ofc remove the code it works, anyone know why ? :/ and yes i have changed $domain to my domain! $domain=â€myproxy.comâ€; // If no request: if($_GET[’q']!=â€"){ // 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[’q']!=â€"){ // Redirect to homepage and finish script header(â€Location: http://www.†. $domain . “/â€); exit(); } } } Code (markup):
Try this code (I suggest you copy and paste it ), I tested it on a default install of PHProxy so it should work. $domain = "myproxy.com"; // If no request: if($_GET['q'] != ""){ // 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['q'] != ""){ // Redirect to homepage and finish script header('Location: http://www.' . $domain . '/'); exit(); } } } Code (markup): Hope it helps, if not let me know and i'll try again
hey, now it works. but try to use it, now it only goes to the main page all the time cant surf to any page after adding that http://www.proxylure.com/test/
try changing $domain = "myproxy.com"; to $domain = "http://www.proxylure.com/test/"; I know you probably changed it to your domain but add /test/ to the the end if you haven't already. That should make it work however, if you move you proxy from /test/ to the root of your domain then you will have to take the /test/ off the end of it.
hey again. that didit work :/ now an extra / comes up in the end when i try to use it... it becomes http://www.proxylure.com/test//
hmm... I'm not sure what else would be causing it to not allow you to browse. What is happening is it thinks you are "hotlinking" or "leeching" bandwidth from yourself (lol) because it doesn't show that the referer is from your site (which it would be if you were using your proxy to browse to another site rather than "hotlinking" through your proxy to another site.
i now removed the code you quoted and tryed it now, it works, someting in that code that is supposed to "deny" hotlinking messes it up :'( that wont work as if you look at this line! header('Location: http://www.' . $domain . '/'); it put that in automaticly.