Re: CGI scripts / Location header

M. Hedlund ([email protected])
Fri, 13 Oct 1995 11:59:55 -0700


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 <[email protected]>