DirectoryMatch used withy negative lookahead regex

Discussion in 'Apache' started by bubble1975, Oct 2, 2009.

  1. #1
    Hi Ya'll,

    I'm trying to formulate a negative lookahead regex with DirectoryMatch (apache 2.2.3) and am having big problems with it. I have this directory structure:

    /var/www/cgi-bin
    /var/www/html
    /var/www/error
    /var/www/foo

    What I want is a DirectoryMatch stanza that matches everything EXCEPT /var/www/foo. I've tried:

    <DirectoryMatch "/var/www/(?!foo)">
    ...stuff...
    </DirectoryMatch>

    also tried:

    <DirectoryMatch "(.*)(?!foo)">
    ...stuff...
    </DirectoryMatch>

    Nothing seems to work... Anyone have any insight as to what I'm doing wrong?

    Thanks in advance for any input!!
     
    bubble1975, Oct 2, 2009 IP