Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Set HTTP Status code

by aaron_baugher (Deacon)
on Nov 17, 2011 at 17:26 UTC ( #938651=note: print w/ replies, xml ) Need Help??


in reply to Set HTTP Status code

You're telling it to return a 404 Not Found error, and it appears to be doing that, just adding some language to it. I'm not a mod_perl expert, but could it be that mod_perl is getting the 404 header, recognizing it, and then sending it to the browser in its own words, ignoring the rest of your script's output?

Aaron B.
My Woefully Neglected Blog, where I occasionally mention Perl.


Comment on Re: Set HTTP Status code
Re^2: Set HTTP Status code
by molybtek (Novice) on Mar 09, 2012 at 01:02 UTC
    This is getting weirder... Using a test script as shown below, it works with mod_perl.
    #!/usr/bin/perl use CGI qw/:standard/; header(-status => 404);
    However, if I specified something in the query string, then the status is still set as 404, however, it displays

    Not Found

    The requested URL /cgi-bin/portal/browselocation.pl was not found on this server.

    Additionally, a 302 Found error was encountered while trying to use an ErrorDocument to handle the request.

      This is getting weirder...

      So its been a few months, but you're still omitting all the critical details. Do you want help, yes or no?

        I'm not quite sure what critical details you need...

        It is hosted on a CentOS 5 machine.

        • Apache is Apache/2.2.3
        • Perl is 5.8.8
        • CGI module is 3.5.9
        • mod_perl is 2.0.4-6.el5

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2014-09-16 18:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (41 votes), past polls