To create a custom error page for your site, the simplest way is to create a new page in your root directory and call it by the error code name. EX: 404.html, 503.html etc. You will need to make an entry to your .htaccess file like any of these (use one or multiple):
ErrorDocument 403 /403.shtml
ErrorDocument 404 /404.shtml
ErrorDocument 500 /500.shtml
Common problems
You can even use existing pages as the resulting page. Say you don't want any visitors seeing 404 errors on your site. You can make your home page the result, like so:
There are many error pages which may be defined.
Client Request Errors
400 - Bad Request
401 - Authorization Required
403 - Forbidden
404 - Not Found
405 - Method Not Allowed
406 - Not Acceptable (encoding)
407 - Proxy Authentication Required
408 - Request Timed Out
409 - Conflicting Request
410 - Gone
411 - Content Length Required
412 - Precondition Failed
413 - Request Entity Too Long
414 - Request URI Too Long
415 - Unsupported Media Type
Server Errors
500 - Internal Server Error
501 - Not Implemented
502 - Bad Gateway
503 - Service Unavailable
504 - Gateway Timeout
505 - HTTP Version Not Supported
NOTE: labeling an error as a server code indicates an issue the server cannot figure out. It could be a DNS issue, faulty script on your site, or many others. By categorizing errors, we can target the real issue more easily when troubleshooting.
