[Colin, please don't forget to Reply-All to CC the list]

Colin Wetherbee wrote:
Stas Bekman said:

Colin Wetherbee wrote:

I want to have my Perl script, upon getting the wrong CGI parameters, to
give a status 404.  Then, the ErrorDocument for 404 goes back to that
same Perl script but with the CGI parameter ?page=error404.

That's the right technique, Colin. Have you imported the constant before using it?

for example see
http://cvs.apache.org/viewcvs.cgi/modperl-2.0/ModPerl-Registry/t/cgi-
bin/status_change.pl?rev=1.3&view=markup


I wasn't importing the constant (because I was explicitly referencing the
Apache:: namespace), but I tried your suggestion, and it produces the same
results (i.e., the server returns an empty page, rather than the 404
ErrorDocument).

Yes, sorry, I meant compiling it (in case it wasn't yet compiled), not importing it.


Perhaps I have the wrong impression of how 404 errors work.  The way I
understand it, my script is supposed to return a 404 status and no
content.  Then, Apache parses this and sends to the browser the 404 status
along with the 404 ErrorDocument.  Is this correct?

Sounds right. May be the ErrorDocument gets on the way and mishandles it? Try modifying the config in modperl-2.0/ModPerl-Registry/t/ and see if you can break that test, since it does exactly what you try to, but there is no explicit ErrorDocument setting. To simplify things


(The same situation occurs when I send content (even just a Content-Type
header) along with the 404 status as when I do not send content.)

Maybe there's an example somewhere of how to properly send a status other
than 200 under mod_perl 2.0?

Please see the tests (there is more than one that returns 404/NOT_FOUND)

Thanks for your continuing assistance.

You're welcome

--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

--
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