perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Prime <adam.pr...@utoronto.ca>
Subject Re: ErrorDocument from a registry script
Date Thu, 07 May 2009 18:21:44 GMT
Michael Peters wrote:
> Michael A. Capone wrote:
>> In the spirit of checking off the obvious things... are you sure that 
>> the ErrorDocument directive is working for other pages?  in other 
>> words, can you open a browser and goto 
>> http://mydomain.com/this_file_does_not_exist.htm and see your 
>> ErrorDocument?\
> 
> Yes, that's how I know that it's not the browser silently ignoring my 
> ErrorDocument (which IE is known to do).
> 
> Has anyone else done this before or can someone confirm to me that it 
> should work? Would help to know that I'm not chasing an impossible dream.
> 

I don't have a mod_perl 1.3 setup handy, but i was able to get it to do 
what you're wanting to do just fine in mod_perl 2

--- httpd.conf

ErrorDocument 404 /404.html

Alias /perl/ /usr/local/prefork/perl/
<Location /perl/>
     SetHandler perl-script
     PerlResponseHandler ModPerl::Registry
     PerlOptions +ParseHeaders
     Options +ExecCGI
     Order allow,deny
     Allow from all
</Location>

--- registry script:

use strict;
use warnings;

use Apache2::Const qw(:common);

my $r = shift;

$r->status(NOT_FOUND);

---

requesting the script results in me seeing the error document found at 
/404.html

Adam





Mime
View raw message