homepage Welcome to WebmasterWorld Guest from
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

Blocking IPs with subnet mask
in .htaccess

 1:45 am on Apr 15, 2002 (gmt 0)

Suppose the IP range is aa.bb.cc.224 - 255

In .htaccess, I want to deny this range. What is the subnet mask?

Deny from aa.bb.cc.224/ ?
Deny from aa.bb.cc.31/ ?

or something else? It's hard to test it. Right now I'm using
Deny from aa.bb.cc
but I don't want to deny from 0-223



 3:15 am on Apr 15, 2002 (gmt 0)

I don't believe there is a "range" operator other than the entire 256 ips in a c block.


 3:51 am on Apr 15, 2002 (gmt 0)

SetEnvIf Remote_Addr "^aa.bb.cc.22[4-9]$" ban
SetEnvIf Remote_Addr "^aa.bb.cc.2[3-9][0¦4-9]$" ban

Place deny from env=ban within <limit></limit> tags.

This should ban every IP between aa.bb.cc.224 and aa.bb.cc.256

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