Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Set HTTP Status code

by aaron_baugher (Curate)
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.

Replies are listed 'Best First'.
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/ 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://938651]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2018-02-23 12:48 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (302 votes). Check out past polls.