Custom Error Pages (E.g 404)
To have a custom 404 error page, just insert one of those lines in your .htaccess (or apache config)
ErrorDocument 404 /404.html ErrorDocument 404 http://yoursite.com/404.html
This will make 404.html in you webroot as the 404 error document. The second line for local URLs is not recommended!
If you have a directory in your website like this http://yoursite.com/directory/, and in that directory you have a .htaccess and want to have a custom 404 page for that directory and subdirectories, use this.
ErrorDocument 404 /directory/404.html
Below are all kinds of errors:
Client Request Errors
400 Bad Request
401 Authorization Required
402 Payment Required (not used yet)
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
Read more about custom error pages in the apache documentation http://httpd.apache.org/docs/mod/core.html#errordocument.