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 开发者_JAVA百科regex is failing. I've also tried:
AliasMatch !^/test$
But that also failed. How can I perform the 'not match'?
In this case, negative lookahead is your friend:
^(?!/?test$).*$
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
^[^(\/test)]
anything that doesn't start with /test
is this what you are looking for?
精彩评论