When a user makes a bad request on a website — trying to visit a page that doesn't exist, for instance — they get taken to a special page called an error page. By default, these pages are provided by the hosting provider, and contain basic information about the error. When we say "basic information," we mean really, really basic — usually just the error code and a short, puzzling phrase that makes absolutely no attempt to explain what happened. In addition, the design for these pages is usually pretty bare, and there are no links to get back to the website the user came from.
That's why many web designers opt to create custom error pages. That way, any time a user makes a bad request, they're taken to a page that looks like the rest of the website. It can contain whatever information the designer wants to include (or, as is often the case, it can make a clever little joke), plus a link back to the rest of the website.
Here are the most common errors your users may encounter (also keep in mind that you can set custom pages for all these errors):
400 - Bad Request: The request contains bad syntax or cannot be fulfilled.
401 - Authorization Required: Authentication is possible but has failed or not yet been provided.
403 - Forbidden: The request was legal, but the server is refusing to respond to it.
404 - File Not Found: The requested file could not be found. It may not exist, or it may be down temporarily.
405 - Method Not Allowed: A request was made of a file using a request method not supported by that file.
500 - Internal Server Error: A generic error message, given when no more specific message is suitable.
503 - Service Unavailable: The server is currently unavailable because it is overloaded or down for maintenance.
However, there are a couple of errors that you cannot create custom pages for. They include:
- The page a user is taken to if they enter their username and password in a login box and then click Cancel.
- The page a user is taken to if they keep entering the wrong login information.
Both these errors occur because the user has not logged into your site, therefore the server cannot display a valid error page.