IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Regex question
I'm trying to filter a range of IPs. If the range is

12.34.56.64 - 12.34.56.95


I've got this:

^12.34.56.(6[4-9]|[7-8][0-9]|9[0-5])$.


That right?
--

Drew
New Apache can do CIDR
especially if its as distributed by a distro.

12.34.56.64-95 == 12.34.56.64/27

But... drop the period at the end of the regex and it should work.

IOW:
^12.34.56.(6[4-9]|[7-8][0-9]|9[0-5])$


This should work if you have rewrite on:
RewriteCond %{REMOTE_ADDR} 12.34.56.(6[4-9]|[7-8][0-9]|9[0-5])
RewriteRule . - [F]
New You could also do it:
This way... so you don;t have to restart httpd every time you update the rules:

RewriteMap filt-bloc txt:/this/is/someplace/filter-ip-block.txt
RewriteCond ${filt-bloc:%{REMOTE_ADDR}} =1
RewriteRule . - [F]

But then, you will have to add the IPs to the text file individually like this:

12.34.56.64 1
12.34.56.65 1
12.34.56.66 1
12.34.56.67 1
12.34.56.68 1
12.34.56.69 1
...
12.34.56.95 1


But its very flexible and handy.
New This isn't on Apache
It's for Google Analytics. They use regex to identify IPs not to log. I need to put in the range that my employer owns, so it doesn't log hits from me.
--

Drew
New I'm surprised they don;t do CIDR
Its terribly easy.

Oh well.
     Regex question - (drook) - (4)
         Apache can do CIDR - (folkert) - (3)
             You could also do it: - (folkert)
             This isn't on Apache - (drook) - (1)
                 I'm surprised they don;t do CIDR - (folkert)

Real live veggie burgers -- they cook 'em 'til they're pink.
83 ms