I was working on an issue yesterday, and realised it was caused by an error in the Dispatcher filters.
The developer had (understandably) expected the Filters to 'see' the URL passed down from preceding handlers (ie mod_rewrite). However, as described in the documentation, this is not the case:
Since Dispatcher 4.0.11 it is no longer necessary to set DispatcherUseProcessedURL 1 (in httpd.conf when using with Apache).
The filter section will always be applied to the unprocessed, sanitized URL, as received by the web server.
This got me thinking - is this really the behaviour we'd want from Dispatcher?
Doesn't it force us to open filters wider than we really need to... for example, if you were to follow the technique described in the link below (effectively resolving mapped content paths in the Apache using mod_rewrite) you'd still have to Allow * as the filters wouldn't be applied to the resolved content paths (ie /content/mysite/...).
If the filters worked on the processed URLs you could allow /content/mysite/* which seems a lot neater to me.
Does anybody else thing this seems a bit odd? Am I missing something (ie a good reason for it to work in this way)?
please use the latest dispatcher version 4.1.2 it works on the processed URL.
Aha thanks very much, that is an excellent tip.
As far as I can see, that's a much more intuitive behaviour.