R
Rui Maciel
In a perl CGI script, is it possible to throw a 404 error? If so, how is it done?
Thanks in advance,
Rui Maciel
Thanks in advance,
Rui Maciel
Keith said:Read the CGI module docs under "CREATING A STANDARD HTTP HEADER".
Sherm said:You expected a page? Did you print one?
Ah, I see the misconception now. Browsers don't have default 404 pages,
servers do. The browser will display whatever content is sent after the
headers.
Yes, exactly. The document can be as simple or as fancy as you like.
If you want to mimic your server's default document, just hit a non-
existent URL on your server, and save the HTML it sends in response.
Peter said:It's interesting to note that what is displayed depends on the browser.
Firefox seems to treat a 404 response exactly like a 200 response: It
just displays the content sent by the server.
IE and Google Chrome display a browser specific error page instead
(but if I remember correctly IE does this only if the error page sent by
the server is very short).
This then begs the question, what are you trying to accomplish in
sending a 404 response to the client?
Keith said:This then begs the question, what are you trying to accomplish in
sending a 404 response to the client?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.