apache 2.4 LocationMatch not catching

831 Views Asked by At

I need to set htaccess directives in a virtual host for everything that isn't either / or /example/{anything}. I've looked at everything I can find an it seems like apache is doing something weird with regex I can't figure out why it's not working.

Here is what I am trying, maybe someone can help me.

<Location "/">
  ...
</Location>
<LocationMatch "^(?!/example/.+)$">
 ...
</LocationMatch>

I'm stumped I've been trying different approaches all day.

Adding more to this the positive version of the regex works fine so

<LocationMatch "^(/example/.+)$">

works as expected, just the negative version always fails.

0

There are 0 best solutions below