Perrin Harkins wrote:

On Mon, 2004-03-15 at 16:23, Jean-Michel Hiver wrote:


Yes, what I'm trying to achieve is get Apache::Registry to send custom 404 pages - just like under mod_cgi.



I assume that means you want to be able to run the exact same script under mod_cgi?

Well, yes - otherwise i'd be using straight mod_perl handlers.

And you don't want to make this script be your
ErrorDocument?

I don't understand this part. Basically the script uses PATH_INFO to simulate a file structure.

For example, if you request '/foo/' it is really cgi-bin/script.cgi/foo/.

Now /foo/ might be an existing document, in which case I need to return a 200 OK.

But it might not exist, in which case I need to send a 404 and a custom error page.


If you're curious about why I'm trying to do this, it's on CPAN so you can take a look for yourself:


sudo perl -MCPAN -e 'install MKDoc::Core'


Installing a sample site is not too hard:


http://search.cpan.org/~jhiver/MKDoc-Core-0.1/lib/MKDoc/Core/Article/Installation.pm


At the moment I'm using the horrible 'empty ErrorDocument' hack... but it's a hack :(


Basically, you need to turn off PerlSendHeader and
manage the headers yourself. One thing you could do is use the header()
function in CGI.pm. This produces the same results under mod_cgi.


So basically turning off PerlSendHeader and using CGI.pm. Interesting. I'll give it a shot.

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to