homepage Welcome to WebmasterWorld Guest from 50.17.86.12
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
IP ranges in .htaccess
Jordo needs a drink

5+ Year Member



 
Msg#: 3283468 posted 5:56 am on Mar 16, 2007 (gmt 0)

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

5+ Year Member



 
Msg#: 3283468 posted 8:17 am on Mar 16, 2007 (gmt 0)

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

coopster

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



 
Msg#: 3283468 posted 11:50 am on Mar 16, 2007 (gmt 0)

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

trillianjedi

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



 
Msg#: 3283468 posted 12:00 pm on Mar 16, 2007 (gmt 0)

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

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



 
Msg#: 3283468 posted 2:47 pm on Mar 16, 2007 (gmt 0)

> 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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved