Home: Perl Programming Help: Intermediate:
Change response code from 404 to 200



superman183
Deleted

May 2, 2000, 10:39 PM


Views: 1782
Change response code from 404 to 200

Hi,

I realise that this may not be the "absolutely most correct" forum to ask, but if someone has any ideas, or if anyone can point me in the right direction then would be grateful.

On a couple of freebie servers I notice that when a page doesn't exist (if being spidered for example) then the host doesn't actually return an error 404, but does still produce a page, which effectively has the URL of the page requested. i.e. it seems to be able to throw away the 404 response before coughing up the output. I don't mean a re-direct, or similar, but actually changing the 404 response into (what I guess would be) a 200 response. I know that most servers don't do that, but I'm not even sure how it can be done unless it's some sort of Apache mod - any good info appreciated.

Regards,
superman183


Jasmine
Administrator

May 3, 2000, 11:17 AM


Views: 1782
Re: Change response code from 404 to 200

Try:

print "Status: 200 OK\r\nLocation: $urltodisplay\r\n\r\n";

Good luck!


turkscripts
Deleted

May 7, 2000, 6:56 PM


Views: 1782
Re: Change response code from 404 to 200

Hello,
<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">quote:</font><HR>
The host doesn't actually return an error 404, but does still produce a page, which effectively has the URL of the page requested
<HR></BLOCKQUOTE>

Yes, this happens in the web server level...