[9162] in www-talk@info.cern.ch
Re: CGI scripts / Location header
daemon@ATHENA.MIT.EDU (M. Hedlund)
Fri Oct 13 15:03:44 1995
Date: Fri, 13 Oct 1995 11:59:55 -0700
To: Daniel DuBois <ddubois@rafiki.spyglass.com>, www-talk@w3.org
From: hedlund@best.com (M. Hedlund)
Resent-From: www-talk@w3.org
At 9:14 AM 10/11/95, Daniel DuBois wrote:
>Scenario: User requests a URL that points to an existant CGI script. CGI
>script returns a "Location: localfile.html" header, indicating a
>'server-side' redirect, and this file doesn't exist.
>
>Is it proper to send a 404 Not Found message? The URL is found, but the
>output of the CGI script isn't. Is it better to send a 500 Internal Error
>message?
The CGI script should decide. If it can't cope with not finding the file,
it will not send a proper response and likely cause a 500 (or an empty
document). If it can, it should send a 404 with some HTML explaining the
problem. If you send a 500 from a properly-functioning script, it will
appear as though the script is malfunctioning when it is not.
The script is acting as part of the server, and should react as the server
would.
M. Hedlund <hedlund@best.com>