On Fri, 14 Jun 2002, Geoffrey Young wrote:
> that's odd. the above code essentially acts as though the user entered
> /not_ok_page.html in their browser all by themselves. maybe I
> incorrectly assumed that's what you were looking for?
>
well the problem with a onsite url is that the handler would have to
process that as well (unless i checked $r->uri for that specific uri. of
failure or DECLINED aspect works 100% perfect. its the non-DECLINE that
doesnt work
>
> Apache only gives handlers one shot at translating the URI to a
>
does this mean 'apache only gives one and only one shot shot a
translating a url' or 'apache gives each handler one shot at translating a
url'? i assumed that after 'PerlTransHandler ModuleName' is done
mod_rewrite can still take a stab at the url.
>
> filename. So, you can either trick apache by changing the URI and
> returning DECLINED, which lets Apache handle the translation for you,
> or map the filename yourself (as you do below) and return OK.
>
if I use this peice of code (solely as a way of trying to find the
problem) ...
sub handler {
my $r=shift;
$r->filename($r->document_root . $r->uri);
return OK;
}
... i will get this for all requests
[date/time] [error] [client ip] File does not exist: /
> it's early here, and I haven't had my coffee yet, but what you're
> written should be essentially the same as the short snipped I provided
> (save the possibility of redirecting to an offsite URL).
>
your part (the DECLINED) works perfecto ... thanks again
sub handler
{
my $r=shift;
if(sysdiag($r)) {
##
## somethng wrong here
##
$r->filename($r->document_root . $r->uri);
return OK;
} else {
##
## this works perfect
##
$r->warn("Apache::Kosher($state)");
my $url=$r->dir_config('KosherRedirect');
$r->content_type('text/html');
$r->header_out(Location=>$url);
return REDIRECT;
}
}
---
Gabriel C. Millerd | Real Men don't make backups. They upload it via ftp
Super Plumber | and let the world mirror it. -- Linus Torvalds
|