Welcome to WebmasterWorld Guest from 18.206.194.83

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Check my htaccess code please

How to block spamming sites

     
3:44 pm on Nov 10, 2003 (gmt 0)

New User

10+ Year Member

joined:Nov 9, 2003
posts:15
votes: 0


Hi all,

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

Order Allow,Deny
Allow from All
Deny from examplenet.nl
Deny from env=bad_bot

Kid

[edited by: jdMorgan at 3:51 pm (utc) on Nov. 10, 2003]
[edit reason] No real IPs or hostnames, please. [/edit]

3:58 pm on Nov 10, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Kode_Kid,

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.

Jim

4:15 pm on Nov 10, 2003 (gmt 0)

New User

10+ Year Member

joined:Nov 9, 2003
posts:15
votes: 0


... 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.

:)

4:25 pm on Nov 10, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


One way to cover IP ranges: [webmasterworld.com...]

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...]

Jim

4:45 pm on Nov 10, 2003 (gmt 0)

New User

10+ Year Member

joined:Nov 9, 2003
posts:15
votes: 0


Thanks JD, i appreciate your time. I didn't know that was the IP address in the log entry.

I'm learnin' ....... :)

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members