Welcome to WebmasterWorld Guest from 18.104.22.168
Can somebody look over my htaccess code to see if it should be doing what i want it to do?
I have a site (qn-213-xx-197-30.examplenet.nl) and a user agent (badapp 1.1 (www.example.com)) sucking the bandwidth off one of my sites.
I wrote the following htaccess file to block both from future access. Will this work?:
SetEnvIfNoCase User-Agent "^badapp" bad_bot
Allow from All
Deny from examplenet.nl
Deny from env=bad_bot
[edited by: jdMorgan at 3:51 pm (utc) on Nov. 10, 2003]
[edit reason] No real IPs or hostnames, please. [/edit]
Welcome to WebmasterWorld [webmasterworld.com]!
You code looks fine. However, it would be much more efficient to block examplenet.nl by IP address, rather than by remote-host. Using an IP range would eliminate an additonal reverse-DNS lookup on every request to your server. Reverse DNS lookups are slow, so avoid using remote-host whenever possible.
You can easily test your code by substituting your own hostname or IP address in the code, and by changing your user-agent by editing it or by using a user-agent spoofing tool.
... it would be much more efficient to block examplenet.nl by IP address ...
Where would i look up the IP address for a server in the netherlands? I tried using some whois sites but they all come up blank and refer me to a whois site in the netherlands that does nothing more than confirm the site exists.
Also, if their IP covers a range of IPs, how do i cover that range in my htaccess? I used to know this, but it's been a long time since i've delved into this htaccess stuff.
Any help would be greatly appreciated.
Please take a look through the previous posts here in this forum - there are many more examples to be found.
The IP address is already there in your log entry - it's just obscured using dashes instead of dots. You can look it up at [ripe.net...]