I have a huge problem. Someone is sending tens of thousands of hits to my site with different IPs most of the time. Each requests is sent through several clickbank linkscodes. When I look in my logfiles I see that all hits go to this file first with the affiliate id after the = /hoplink.php?hop=affiliateid and then continue to / (hoplink.php sends them to /) and load all pictures etc. This takes a lot of resources from my server. Is there away to block all requests comming from "affiliateid"? Thanks in advance.
You could do a mod_rewrite rule in a .htaccess file with a regex pattern match for anything with hop=affiliateid Code (markup): This would be similar to hotlink protection and just forward them to another page elsewhere or a new page on your site telling them to go away. Something like this ought to work: RewriteRule ^hoplink.php?hop=affiliateid$ /go-away.jpg Code (markup):
Thanks Damonp but I tried what you wrote but nothing happend. Really strange Perhaps there is an error in my server config for apache? or did an error sneak into your code? Thanks
Thanks damonp for the idea. I learned the rest from FQA by Nintendo. Andy, I was working on the similar thing today and this works perfectly, I use the second option: RewriteEngine on RewriteBase / RewriteRule ^hoplink.php?hop=affiliateid$ http://www.domain.com/goaway.htm [R,NC] If you had the hoplink.php say in /scripts/ directory then add it in as per below: RewriteEngine on RewriteBase /scripts/ RewriteRule ^hoplink.php?hop=affiliateid$ http://www.domain.com/goaway.htm [R,NC]
I just had a thought, try it also just with hoplink.php it might be better RewriteEngine on RewriteBase /scripts/ RewriteRule ^hoplink.php$ [url]http://www.domain.com/goaway.htm[/url] [R,NC] Code (markup):
Hi, thanks for all help but neither worked. I think it is the apache webserver that is messed up. But I'm moving to a new host now anyway so I'll just make sure the apache works as it should on the new one. andy