Forum Moderators: DixonJones

Message Too Old, No Replies

Writing Expression to block ip range

Help

         

guillermo5000

2:04 am on Aug 31, 2003 (gmt 0)

10+ Year Member



Hello,

I would like to block these two ip ranges. But am having trouble writing the expression.

Netsweeper FW-NETSWEEPER-1 (NET-66-207-120-224-1) 66.207.120.224 - 66.207.120.239
Netsweeper FW-NETSWEEPER-2 (NET-66-207-119-232-1) 66.207.119.232 - 66.207.119.239

This is what I came up with, is this correct? Thanks all.

RewriteCond %{REMOTE_ADDR} ^66\.207\.120\.(22[4-9]¦23[1-9])$ [OR]
RewriteCond %{REMOTE_ADDR} ^66\.207\.119\.(23[2-9])$ [OR]

claus

2:09 am on Aug 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It will work just fine... you just need to consider the zero in .230 (the first one) as well, and if you're strict you don't really need the parenthesis in the second :)

RewriteCond %{REMOTE_ADDR} ^66\.207\.120\.(22[4-9]¦23[0-9])$ [OR] 
RewriteCond %{REMOTE_ADDR} ^66\.207\.119\.23[2-9]$ [OR]

/claus

guillermo5000

2:24 am on Aug 31, 2003 (gmt 0)

10+ Year Member



Thank you!