How can I modify messages that visitors of my pages get when errors occur?

The World-Wide Web server on Eniac allows users to specify URLs to be displayed in place of default messages when errors (such as "Not found") occur. This is achieved by placing an ErrorDocument directive in the ".htaccess" file. This file is described in greater detail in a separate article.

The directive is specified as follows:

     ErrorDocument  error_code html_file
For example, to display the URL whenever a non-existent file in directory ~username/html/mydir/ gets accessed, put the following into the ~username/html/mydir/.htaccess file:
     ErrorDocument 404 /~username/mydir/myfile.html
For full details on the ErrorDocument directive, see the Apache Documentation.


© Computing and Educational Technology Services | Report a Problem | 215.898.4707