NearlyFreeSpeech.NET provides a basic error page in response to most common types of site errors. Sometimes, you may wish to override these pages and provide your own error messages that fit your site style or provide additional information. In order to do this, add the following line to the .htaccess file in your public directory (you'll need to create this plain-text file first if you don't have one):
ErrorDocument 404 /err404.html
Where 404 is the number of the error you wish to catch and err404.html is the name of the file you want displayed when an error occurs. You may use a PHP or CGI script for an ErrorDocument, but be careful not to use absolute paths to specify the name of your ErrorDocument.
Here are the most common errors:
- 401 Authorization Required
Indicates that a username and password are required but were not provided or were incorrect too many times.
- 403 Forbidden
Indicates that security restrictions prevent the requested page from being returned. This is the error returned for brand new sites, because our security prohibits directory indexing without an explicit index file.
- 404 Not Found
Indicates that the requested page or object was not found, either due to a typo or a broken link.
- 500 Internal Server Error
Usually indicates that a CGI script encountered an error.
Due to the design of our network, you cannot use an ErrorDocument to catch a 503 Service Unavailable error. Such errors do not routinely occur except during system maintenance. They may also occur during some types of partial service interruptions.