On 31 Dec 2014, at 5:56 PM, Eric Covener <cove...@gmail.com> wrote: > For a URL of http://example.com/foo/bar/baz.html > > # this matches against baz.html only > <FilesMatch (.*\.html)$> > Redirect http://other.example.com/$1 > </FilesMatch > > You would not have any way to match or capture some part of /foo/bar/. > You could use the entire URL in an expression, but I think it would > be difficult to tease it apart, and even making it just conditional > would require something like wrapping in <if>. I think there are some > big gaps in string-valued expressions, even if you do try to write a > sophisticated one (this has popped up for me in a handful of contexts > and I have flailed around in the grammar to no avail)
This limitation affects the whole of the expression API, which covers more and more directives, so if this is a real problem we should fix it. Would it make sense to add a modifier to FilesMatch to indicate we want to match against the full path instead of just the filename, for example: <FilesMatch ~ ^/full/(path)/to/(file)$> Alternatively, what would the impact be of allowing LocationMatch inside htaccess? Regards, Graham —