httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <>
Subject Re: [users@httpd] Re: Set Environment for range of addresses
Date Sat, 04 Aug 2007 17:36:33 GMT
On 8/4/07, Crash Dummy <> wrote:
> > SetEnvIf accepts only regular expressions, not CIDR notation.
> > Fortunately, most groups of IP addresses can be expressed with regexes
> > (although often with a little more effort). What you want is simple:
> > SetEnvIf Remote_Addr ^192\.168\. dontlog
> Ah, thank you! I am a newbie, and "regexes" still scare me, paricularly the
> strange syntax. For example, why would that one start with "^" but not end with
> "$" like many do?

Google for regular expressions and you'll find tons of tutorials.

The ^ indicates that the match must start at the beginning of the
Remote_Addr. Since I don't know what is going to be at the end, I
don't care about the last part and therefore don't use $ to indicate
that the match finishes at the end of Remote_Addr. I could have
equivalently (but less efficiently) used ^192\.168\..*$ to indicate
that I'll accept anything at all after the 192.168 up to the end of
the Remote_Addr.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message