You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Paul <yd...@yahoo.com> on 2001/04/12 19:26:13 UTC

negative LocationMatch syntax?

Hi all.

I need to leave a few areas of our site freely accessible, but most of
the site is restricted, and I'd like the default behavior to be
restrictive. I don't want to have to remember to change the config if I
add new directories, as in adding 
<Location>
SSLVerifyClient require
</Location>

Is there a way I could use <LocationMatch> to specify a not condition?
as in 
<LocationMatch !~ "/(thisfile|thatDir|whatever).*">
SSLVerifyClient require
</LocationMatch>

That would let me list the exceptions, and everything else would be
restricted by default......

???


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

Re: negative LocationMatch syntax?

Posted by Matt Sergeant <ma...@sergeant.org>.
On Thu, 12 Apr 2001, Perrin Harkins wrote:

> Matt Sergeant wrote:
> > > Is there a way I could use <LocationMatch> to specify a not condition?
> > > as in
> > > <LocationMatch !~ "/(thisfile|thatDir|whatever).*">
> > > SSLVerifyClient require
> > > </LocationMatch>
> > >
> > > That would let me list the exceptions, and everything else would be
> > > restricted by default......
> > 
> > It's really frustrating, but this is *not* possible...
> 
> Maybe with a <Perl> section?

You might be able to do this, but things of course are different as you'd
have to set all your config options in Perl, rather than as
plain directives. I'd like to see it done, all the same.

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\


Re: negative LocationMatch syntax?

Posted by Perrin Harkins <pe...@elem.com>.
Matt Sergeant wrote:
> > Is there a way I could use <LocationMatch> to specify a not condition?
> > as in
> > <LocationMatch !~ "/(thisfile|thatDir|whatever).*">
> > SSLVerifyClient require
> > </LocationMatch>
> >
> > That would let me list the exceptions, and everything else would be
> > restricted by default......
> 
> It's really frustrating, but this is *not* possible...

Maybe with a <Perl> section?

Re: negative LocationMatch syntax?

Posted by Matt Sergeant <ma...@sergeant.org>.
On Thu, 12 Apr 2001, Paul wrote:

> Hi all.
> 
> I need to leave a few areas of our site freely accessible, but most of
> the site is restricted, and I'd like the default behavior to be
> restrictive. I don't want to have to remember to change the config if I
> add new directories, as in adding 
> <Location>
> SSLVerifyClient require
> </Location>
> 
> Is there a way I could use <LocationMatch> to specify a not condition?
> as in 
> <LocationMatch !~ "/(thisfile|thatDir|whatever).*">
> SSLVerifyClient require
> </LocationMatch>
> 
> That would let me list the exceptions, and everything else would be
> restricted by default......

It's really frustrating, but this is *not* possible... However here's a
hack I've used that kinda works:

<LocationMatch "([^[.thisfile.]]|[^[.thatDir.]]|[^[.whatever.]]).*">

It's ugly, but it works for some cases, but not all (in fact the above
might not work - I haven't tested it).

See regex.7 in src/regex in the apache distribution for more docs on what
you can do.

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\