![]() |
|
|
Lost Error TrafficKeeping traffic that has gotten lost is a very important aspect for any site. Lost traffic? What*s that? Lost traffic is the users that have come to a site and the page is no longer available, there is a server error, or a programming error. Most of the time the webmaster aren*t aware of such things and the user hits his back button and heads to another site with the same information. This user is now lost and probable wont visit the site with errors again. There is a surprising number of this type of visitor and learning to harness these visitors is a great way to boost traffic to any given site. In this article we*ll explain how to harness the visitors that have found missing pages, incorrect entries, errors in programming, or unauthorized access. Keeping a close eye on traffic analysis and statistics is very useful in limiting the number of errors and other related problems for a web site. If we have less errors, unauthorized access, and/or missing pages; files, documents, or media, the more visitors we can retain and generate. The more visitors we can retain, the larger a site will grow and expand. Error Pages Error pages are those boring pages that a user may see when they load a page that isn*t there. The 404 error pages that just read contact the webmaster and let them know the page is no longer there. No one ever really contacts the webmaster letting them know that a page is missing or contains errors. The user simply hits the back button and visits another site with the same information they might have been looking for on the previous site. We need to harness these users and figure out a way to keep them on the site and re-direct them to another portion of the site that may contain the information they seek. To do this we*ll use custom error pages. The default pages work for some, but for most a custom error page is needed and is very simple to produce. With the help of an .htaccess file we*ll be able to achieve this. This will produce great results and allow a site to harness those ※lost§ users and redirect them to another portion of a site. .htaccess .htaccess can be used for many different things. The main use for this file is telling the server what to do when a user visits a certain folder or file within a site. In this case we*re going to tell the server to direct the users that have reached a page in error to load a specific page for each error message. This will let us customize the information displayed for each error. There are many different errors a user can encounter within a given web site. We*ll stick to the most common of these errors. Below is a list of common server errors and their meanings. Remember to provide information about each error message for each custom error page. This will let a user know what has happened, so they don*t perform the same mistake again. Common Errors 400 每 Bad Request A bad request error lets a user know that that the request could not be understood by the server. Normally this is a scripting error on the programmers* part. Checking web site logs regularly will show errors such as this so a webmaster can correct them. 401 每 Unauthorized Unauthorized access error is used when a user has provided incorrect login information or doesn*t have access rights to enter a given section of a website. .htaccess can be used here also to restrict or password protect any given section of a web site. 403 每 Forbidden Forbidden error lets a user know that the given section of a site is forbidden and even proper login information can not be used to access it and the request should not be repeated. This type of error is only displayed when a section of a site isn*t accessible by anyone. 404 每 Not Found The not found error code is normally displayed when a user has reached a page that doesn*t exist or is no longer available. 404 每 Not found can also be used for files, documents, and media. 500 每 Internal Server Error Internal server errors mean the server has encountered an unexpected condition which prevents it from fulfilling the request. Internal server errors are present in allot of server side programs, like Pearl. The error codes and messages above are the most common that accrue on most sites. A list of all error codes and their meanings can be found at HTTP/1.1: Status Code Definitions. Now that we know which error messages and codes to use we can now start constructing the .htaccess file that will be used to redirect users to the proper information if any of these errors accrue. First thing to look at is the command used to tell the server what to do when a given error accrues. This is a simple line of code that is very self explanatory. Sample .htaccess File: ErrorDocument 404 /404.htm The above is a sample of an .htaccess file. A) ※ErrorDocument§ tells the server to look out for any errors that may accrue with a user. This basically tells the server that if error 404 accrues to redirect the user to ※404.htm§ in the root directory. This example can also be used for the rest of the error code syntax. Below is an example of an .htaccess file that contains all the error codes mentioned above. Sample .htaccess File (All common error codes): ErrorDocument 400 /400.htm Remember to save the file as ※.htaccess§ and upload it to the rood directory of the server. .htaccess files can be used in any directory within a site. Custom error pages can be produced for subfolders or sites within the main site. A simple test can be preformed to check the 404 error. Type anything after the sites domain name that the .htaccess file has been uploaded to. If the custom error page that we*ve just created appears, then the script worked and can be used for any other custom error pages. Thing to Include There are a few common things to include within a custom error page. First off explain to the user what actually happened, be sure to explain it so the user can understand what happened. Provide a link back to the home page, or include the sites GUI (Graphical User Interface) so the user can navigate to another section of the site without hitting back. A search engine on the custom error pages is also very important. This lets the user search for what they were searching for to begin with. Providing this simple information on each error page will rescue those lost users and gain them back as users. Just keep in mind what you*d do if something had happen like this on another site. This is what a normal user would also do. By providing simple explanations as to what happened and a link back to the home page or a navigation menu, the user can find their way back with no problems at all. Gary Winnick |
|
| © Copyright 2006 WebMater-Haven.com All Rights Reserved. |