WebsiteKnowledge Base

UNIX Error Pages

.htaccess style error pages

In the root of your website (/www) you can create a file named .htaccess with lines for each error code and what page they should go to.

ErrorDocument 403 /error.html
ErrorDocument 404 /notfound.php

In that example, attempts to load pages that are "forbidden" (usually by access control) will see error.html located in your /www folder. Also in that example, attempts to load pages that no longer exist will display the php file notfound.php also located in /www.

Here is a list of Error Codes that can appear:
Code Meaning
204 No content
206 Partial content
301 Moved Permanently
302 Moved Temporarily
303 See Other
304 Not Modified
400 Bad Request
401 Unauthorised
403 Forbidden
404 Not Found
410 Gone
411 Length Required
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout