dave
dave

Reputation: 7857

How can I get Apache to "not match" my given AliasMatch?

Here's my current regex:

 AliasMatch ^/?=(test)$ /srv/test.com/python/load.wsgi

Basically, I'm trying to send everything but the URL /test to my load.wsgi file so that everything else will be handled by PHP.

This regex is failing. I've also tried:

AliasMatch !^/test$

But that also failed. How can I perform the 'not match'?

Upvotes: 0

Views: 2208

Answers (3)

Devin Ceartas
Devin Ceartas

Reputation: 4829

mod_rewrite is more flexible and allows any number of RewriteCond statements to modify the conditions under which a RewiteRule will be applied, such as

RewriteEngine On 
RewriteCond %{REQUEST_URI} !^/test 
RewriteRule . /srv/test.com/python/load.wsgi

Upvotes: 1

ridgerunner
ridgerunner

Reputation: 34395

In this case, negative lookahead is your friend:

^(?!/?test$).*$

Upvotes: 1

Murali VP
Murali VP

Reputation: 6417

^[^(\/test)]

anything that doesn't start with /test

is this what you are looking for?

Upvotes: -1

Related Questions