Forum Moderators: phranque

Message Too Old, No Replies

Serving a true 404 from Perl

404 and OK

         

EasySkankin

4:06 am on Dec 18, 2008 (gmt 0)



I am struggling serving a true 404 error in perl using apache

Currently I am getting using this:

my $q = CGI->new;
print $q->header(-status=>'404',-type=>'text/html');

I get back a 404 header saying this:

HTTP/1.x 404 OK

I want to server this instead

HTTP/1.x 404 Not Found

I have searched online and not found a answer.

Can anyone please help

jdMorgan

6:36 am on Dec 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried putting the "Not Found" after the "404" in your status line?

print $q->header(-status=>'404 Not Found',-type=>'text/html');

(I've never tried to force a 404 status in PERL that I can recall, so I'm just asking.)

Jim