You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Graham Leggett <mi...@sharp.fm> on 2013/12/28 22:01:38 UTC
[Patch] LocationMatch (and friends) and back references
On 26 Dec 2013, at 11:45 AM, Graham Leggett <mi...@sharp.fm> wrote:
>> Why not using the standard regex syntax:
>> <LocationMatch ~ "^/(?<MYPREFIX>foo|bar)/baz/(?<MYFILE>.*)">
>
> Is it supported by our current API?
It wasn't, but it is in this patch.
What this patch does is add all matching named variables from all matching LocationMatch/DirectoryMatch/FileMatch to the subprocess environment, uppercased, This opens up the possibility to reference elements of the URL from within directives that have access to the environment. Example like this:
<LocationMatch ^/(?<prefix>.*)/(?<name>.*)>
# PREFIX and NAME are defined here
</LocationMatch>
Regards,
Graham
--