On May 24, 2004, at 5:17 PM, Geoffrey Young wrote:
ok, that still looks funky. here's where I'm coming from, which may be different than where you're coming from :)
Heh, okay, sorry for my density. ;-)_
mod_perl is typically set up to handle stuff correctly. the problem exists
where mod_perl is handling directories without trailing slashes, which
should typically be handled by mod_dir.
the above logic activates mod_perl as the content handler for any URI that
isn't a unix directory. that logic should be reserved for SetHandler or
similar directives within httpd.conf.
Ah, right.
I think what you want to do is activate mod_perl only for things where mod_dir would ordinarily be invoked, namely when the URI resolves to a directory and the URI does not end with a slash.
That's exactly right. So how 'bout this?
sub fixup_handler { my $r = shift; $r->handler('perl_script') # or $r->handler('modperl') if $r->content_type eq DIR_MAGIC_TYPE && $r->uri =~ m{/$}; return HTTP_OK; }
So for directories without a final slash, mod_dir will handle the request; for directories with a final slash, we're telling Apache to let mod_perl (and therefore Mason) handle it. For everything else, we let be what will be (whatever SetHandler determines).
not for the fixup phase. OK will terminate the translation, auth, authz,
and mime phases early, though. for the remaining phases OK just means "move
along", so it will have the same effect. the general practice within Apache
is to use DECLINED to mean "I didn't do anything (or I don't want Apache to
think I did)" while OK means "I did something," even for phases where OK and
DECLINED will have the same effect (like fixups)
Gotcha, thanks.
Regards,
David
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]