Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^6: Set HTTP Status code

by molybtek (Novice)
on Mar 09, 2012 at 03:45 UTC ( [id://958612]=note: print w/replies, xml ) Need Help??


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

it is just saved as test.pl, it is run under mod_perl. No url mapping...

test.pl works as expected, the custom ErrorDocument gets displayed.

test.pl?query has 404 error, but custom ErrorDocument doesn't display, instead the error as specified above.

Replies are listed 'Best First'.
Re^7: Set HTTP Status code
by Anonymous Monk on Mar 09, 2012 at 04:19 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://958612]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2024-04-18 16:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found