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

And what is /cgi-bin/portal/browselocation.pl ?

Did you see Re^4: mod_perl give 404 not_found with content/http://search.cpan.org/~gozer/mod_perl-1.31/faq/mod_perl_faq.pod#So_how_do_I_use_mod_perl_in_conjunction_with_ErrorDocument%3F?

Replies are listed 'Best First'.
Re^8: Set HTTP Status code
by molybtek (Novice) on Mar 11, 2012 at 22:36 UTC

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

      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

      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

      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