Handling Errors
Everybody from time to time, surfing the web, will encounter the famous 404 error page saying that the web page or the document you were looking for was not found. The cause for the error could be a reorganization of the website (the file was removed, renamed or deleted); a user involuntarily mistyping the URL of the page or maybe the web page never existed. No matter the cause, any webmaster will want to avoid having these types of broken links on his website. Besides the 404, “File not found” error code, there are other standard HTML error codes. Here are a few examples:
- A 400 error code indicates that the link or the request could not be understood by the server due to malformed syntax;
- A 401 error code indicates that authorization is required to access the file;
- A 403 error code indicates that the visitor is forbidden to access the file (maybe it’s in a password protected folder or maybe you activated the Hotlink Protection on your images);
- A 500 error code indicates that the web server encountered an unexpected condition which prevented it from fulfilling the request (there are miss configured options on the web server).
Each error code has its own standard page and error message. In order to deliver a better user experience, you might want to customize the error pages with your own messages and directions for the visitor to follow. The idea is that you still need to let the visitor know that something unexpected is going on, but provide him with options.
A good practice is to include the website’s sitemap here (so the visitor can choose a “real” page to go to) or, if you have a website search feature, include it here as well.
If you have cPanel installed on your hosting account, you can see the last 300 errors for your website, by selecting the [Error log] option. Check this log frequently to find out if you have broken links on your site, or, what files do not exist and they should. Use this information to fix the errors and to keep your site running smoothly.

Post a Comment