Thomas Klausner wrote:

Hi!

On Mon, Sep 08, 2003 at 04:51:55PM +0100, Steve Hay wrote:



The project is going to be written as a series of mod_perl handlers - one for the main "home page", and others for various sub-components. Each handler is implemented by a separate module (all sub-classes of a common base class). I don't want to have to configure a separate Location for each sub-component.



You might want to take a look at Apache::Dispatch, which does exactly this.


Will do! I've grabbed it off CPAN and will take a good look at it. It does indeed look like exactly what I'm after.

I'm using something like this with Apache::Dispatch

PerlModule Apache::Dispatch
DispatchUpperCase On # this is /not/ in Apache::Dispatch, # only in my patched version
DispatchPrefix Oe1
DispatchExtras Error


<Location /myproject>
SetHandler perl-script
PerlHandler Apache::Dispatch
</Location>
<Location /myproject/css>
SetHandler default
</Location>
<Location /myproject/img>
SetHandler default
</Location>


This is working as expected, i.e. request for /css/foo.css or /img/bar.png
are not handled by Apache::Dispatch


What about requests for /css or /img ? Are they handled by Apache::Dispatch? The problem I found with my LocationMatch override is that requests for files were caught, but requests for directories slipped through to the Perl handler.

- Steve

Reply via email to