ErrorDocument directive
Purpose
-
The ErrorDocument directive points the server to a file to send in place
of the builtin error message.
Syntax
-
ErrorDocument type filename
Where type is one of:
-
302 - REDIRECT
-
400 - BAD_REQUEST
-
401 - AUTH_REQUIRED
-
403 - FORBIDDEN
-
404 - NOT_FOUND
-
500 - SERVER_ERROR
-
501 - NOT_IMPLEMENTED
And filename is a CGI script or text/html file with full path
from document root. CGI scripts launched via these errors have 3 new environment
variables, REDIRECT_REQUEST, REDIRECT_URL and REDIRECT_STATUS.
They also take as input the error reason of the form err_string=error_reason.
For an example script, see an example.
File
-
srm.conf
Default
-
If this directive is left out, the compiled error messages will be used.
Examples
-
ErrorDocument 403 /cgi-bin/notallowed.cgi
-
ErrorDocument 404 /cgi-bin/nph-error.pl
-
ErrorDocument 500 /serverError.html
-
ErrorDocument 501 /error/notImplemented.html
Return to Resource Configuration File Overview
NCSA HTTPd Development Team / [email protected]
/ Last Modified 7-12-95