I have a generic alias match like:
AliasMatch ^/plugins/([^/]*)/(.*) /usr/share/tuleap/plugins/$1/www/$2
<DirectoryMatch "/usr/share/tuleap/plugins/([^/]*)/www/">
...
</DirectoryMatch>
and I want to add a specific configuration for a directory plugin.
I tried to have an Alias first but it doesn't work as expected:
Alias /plugins/git /usr/share/tuleap/plugins/git/www
<Directory /usr/share/tuleap/plugins/git/www>
...
</Directory>
AliasMatch ^/plugins/([^/]*)/(.*) /usr/share/tuleap/plugins/$1/www/$2
<DirectoryMatch "/usr/share/tuleap/plugins/([^/]*)/www/">
...
</DirectoryMatch>
The specific configuration set for "git" seems ignored in favor of the generic one.
Is there a solution to make it works ?
Best Answer
A possible solution would be to write a regular expression that does not match the URLs you want to exclude.
The matching in
AliasMatch
and some other directives in the Apache Web Server uses PCRE.Most GNU/Linux distributions have
pcre-tools
precompiled. This package contains a couple of tools,pcregrep
andpcretest
, very handy to test Perl compatible regular expressions:In this case, the subexpression
(?!git)
is known as a negative lookahead: