Welcome to WebmasterWorld Guest from 54.196.231.129

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Blocking IPs with subnet mask

in .htaccess

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 10, 2001
posts:748
votes: 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/255.255.255.31 ?
Deny from aa.bb.cc.31/255.255.255.224 ?

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)

Administrator from US 

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 21, 1999
posts:38047
votes: 11


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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 27, 2001
posts:1472
votes: 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

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members