You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Phil Endecott <sp...@chezphil.org> on 2004/11/24 02:05:16 UTC

[users@httpd] Redirect from CGI to error page

Dear Apache Experts,

I've seem lots of docs about how to redirect errors TO cgi scripts, but 
not the other way around.

When my CGI script encounters various error conditions it needs to 
generate a 404 Not Found response.  I was hoping that by just outputing 
"Status: 404 Not Found\n\n" and quitting then Apache would show its 
standard 404 error page, but this doesn't seem to be the case.

Is there some way that I can ask Apache to show error pages when CGI 
scripts generate error Status: headers?

If not, can I add some additional header to explicitly redirect to an 
error page?  (I tried "Status: 404 Not Found\nLocation: error.html\n\n" 
but this didn't seem to do anything.)

Otherwise, presumably I have to copy the actual HTML content of the 
error page into the script.

Any suggestions much appreciated.

Regards,

Phil.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org