Forum Moderators: phranque

Message Too Old, No Replies

Final period in .htaccss?

for banning an IP range

         

Reno

6:07 pm on Apr 12, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm having some trouble with bots crawling my sites that are not from Google, Yahoo, or MSN, and I'd like to stop them using .htaccess. They very often have the same first 3 ranges, but the 4th range changes from crawl to crawl.

Here's the IP example:

Crawl one:
aaa.bbb.cc.ddd

Crawl two:
aaa.bbb.cc.eee

etc

For my .htaccess file, if I want to deny all IP's in that final range (in this example: "ddd" or "eee"), do I need to put the period after "cc"?

So, would it be this:

Deny from aaa.bbb.cc.

or this:

Deny from aaa.bbb.cc

Perhaps it doesn't matter, but I want to make sure I get this right... thanks for any feedback...

........................

jdMorgan

2:03 am on Apr 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Deny from aa.bb.cc
Deny from aa.bb.cc.0/24
Deny from aa.bb.cc.0/255.255.255.0

All are equivalent, using a partial address, network/CIDR notation, and network/netmask notation respectively, and will block the IP address range from aa.bb.cc.0 through aa.bb.cc.255

See Apache mod_access [httpd.apache.org] for more info.

Jim

Reno

2:12 am on Apr 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Jim -- am assuming if they are all equivalent then I only need to indicate one of the three. Appreciate your prompt response...

..........................

coopster

12:29 pm on Apr 13, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



am assuming if they are all equivalent then I only need to indicate one of the three

Yes. Assumption confirmed ;)