Welcome to WebmasterWorld Guest from 54.196.147.57

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

IP ranges in .htaccess

     

Jordo needs a drink

5:56 am on Mar 16, 2007 (gmt 0)

5+ Year Member



Can you block ip ranges in the .htaccess like

deny from ###.###.###.### - ###.###.###.###?

I thought you could, but I have ip's accessing a site, that are in the range I blocked.

SteveWh

8:17 am on Mar 16, 2007 (gmt 0)

5+ Year Member



Yes you can, but not using that format. Search for "CIDR" or "netmask".

coopster

11:50 am on Mar 16, 2007 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Details on how to do so can be found in the Apache manual pages under the Allow [httpd.apache.org] directive.

trillianjedi

12:00 pm on Mar 16, 2007 (gmt 0)

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



I don't mean to take this off track, but blocking a range of IP's, if for the long term, is much more efficiently handled in IPtables (or your firewall if this is a Windows server).

TJ

jdMorgan

2:47 pm on Mar 16, 2007 (gmt 0)

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



> off track

... but most Webmasters are on shared virtual hosting, and have no access to IPtables, firewalls, or anything beyond the limited .htaccess controls -- Which is why we do a big business here in .htaccess issues, and relatively little in server config discussion.

As stated above, the documentation for the Allow directive in mod_access enumerates the various methods for specifying IP address ranges.

Jim

 

Featured Threads

Hot Threads This Week

Hot Threads This Month