in reply to Re^7: Set HTTP Status code
in thread Set HTTP Status code

Oops, copied the response from the original code instead of the test code. Anyway, response is the same apart from the location of the CGI file.

I have looked at the two links provided, however, I don't think they apply to my problem.

I want Apache to display the ErrorDocument, not don't display the ErrorDocument...

Also the problem only appears when the server have mod_perl, using the CGI/CGI::Application module AND there is a query string in the URL...

Replies are listed 'Best First'.
Re^9: Set HTTP Status code
by Anonymous Monk on Mar 12, 2012 at 09:13 UTC

    Say I add httpd.conf  ErrorDocument 404 /error/notexist.html where DocumentRoot/error doesn't exist, then I get

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /perl/test404/junk was not found on this server.< +/p> <p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle t +he request.</p> <hr> <address>Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.7g PHP/4.3.1 +1 mod_perl/2.0.1 Perl/v5.8.9 Server at localhost Port 80</address> </body></html>

    in error_log  [Mon Mar 12 02:06:58 2012] [error] [client 127.0.0.1] File does not exist:  ...htdocs/error

    So your problem is most likely an apache configuration issue

Re^9: Set HTTP Status code
by Anonymous Monk on Mar 12, 2012 at 08:58 UTC

    I have looked at the two links provided, however, I don't think they apply to my problem....

    I think they do, they include everything from apache configuration to perl code, and they work

Re^9: Set HTTP Status code
by molybtek (Novice) on Mar 13, 2012 at 22:06 UTC

    The error document definitely exists, the problem only occurs if there is a value in the query string.

      The error document definitely exists, the problem only occurs if there is a value in the query string.

      :) Yeah, that is what you keep saying ... I don't think you're interested in resolving this