On Thu, 13 Jun 2002, Geoffrey Young wrote:
>
> sounds like a job for a PerlTransHandler...
>
> if ($not_ok) {
> $r->uri('/not_ok_page.html');
> return DECLINED;
> }
>
this works great until i run into an Alias or a mod_rewite rule it seems.
what is the proper way to indicate success here? ora's "writing apache
modules" has this method and the method omitting '$r->filename()' line -
which i have not been able to get to work.
one step away from this .. perhaps a set of logic to act differently is
needed for different requests.
sub handler {
my $r=shift;
if(Apache::MonDiag($r) {
$r->filename($r->document_root . $r->uri);
return OK;
} else {
$r->warn("Apache::MonDiag($state)");
my $url=$r->dir_config('MonDiagRedirect');
$r->content_type('text/html');
$r->header_out(Location=>$url);
return REDIRECT;
}
}
---
Gabriel C. Millerd