Most Read

Most Read

Setting up Team Discussion Board

SharePoint 2007 has a Team Discussion Board that is used to initiate discussion and get replies on topics of interest. This article outlines the steps required to setup a discussion board, managing...
+ Full Article

More Popular Articles

Recent Articles

Recent Articles

Repeating Excel Header Rows

If your worksheet has several pages, it will be useful to have the header row repeat in all the pages. This will improve productivity as the user need not flip to the first page to view the header...
+ Full Article

More Recent Articles
How to define custom HTTP Messages PDF Print
User Rating: / 5
PoorBest 
Web - Web Design
One of the common messages users encounter while surfing the web is HTTP 404 error - The page cannot be found. This might happen when the web page has moved to a new location, web page is no longer available, or the user typed the wrong URL etc. Normally, the default browser page appears with the page not found message. A custom error message can also be setup that would present some options for the user and retain the user's interest in your website. The error can be from the client or server; client error messages are prefixed with 4xx (e.g. 404, 400, 403 etc) and server error messages are prefixed with 5xx (e.g. 500, 501, 502 etc). This article outlines the client side error messages and specifically 404 errors.

Options

  • A search box can be included in the custom error page.
  • Display couple of important links in your website including the Home Page, for the user to continue browsing.
  • Simply redirect the user to the main page or any other page. This might, however, confuse the user as to the status of the requested page.
  • Having a link to a site-map is a good option.
The above list is by no means exhaustive; you can be as creative as you like.


How to create a custom error page

  • Create a custom error page - Create a custom error page (e.g. error. htm) and include information you deem necessary. The options discussed above would give you an idea of the type of content to include. Even if you are having a custom error file, some browsers might still ignore the custom file and display its own message, if the file size is small. Ensure that your custom error file size is around 5K to avoid this.
  • Modify .htaccess - The .htaccess is used, among other things, to process error messages using ErrorDocument command. This command takes an error code and an URL for redirecting the error. The .htaccess is normally found in the main root directory of your website. If there is no such file create one using a Text editor such as Notepad or Textpad and save it as .htaccess( include the dot). If there is an existing .htaccess, open it using a Text editor and suitably modify it. Make a backup of the existing .htaccess before editing as a wrongly written .htaccess may not display your website properly. Add the following line:

ErrorDocument 404 /error404.htm

In the above example, error404.htm is the custom error file placed in the root web directory (e.g. html or wwww etc.); 404 denotes the error code , File Not Found.

Similarly, add a separate line for each error code. For example:

ErrorDocument 401 /401.htm ErrorDocument 403 /403.htm

Example

Here is an example of error404.htm. As explained in the earlier section, you can have any verbiage here as you think fit.

The requested page is not available. ReferPages.com is ever changing. We have redesigned our website and in the process of mapping the old site to the new one. While you are here, take a moment to browse the website by starting at our Home Page. The cause of this error has been noted and we would update our site at the earliest.


Common HTTP Error Codes

401 - Unauthorized: This happens when you do not have permission to view a page using the credentials supplied i.e. page is password protected. Common reason is entering wrong username/password.

403 - Forbidden: This denotes that you do not have permission to access the file/directory. The file or directory is not set to be 'Public'

404 - Not Found: This denotes that the file is not available on the server. This happens in cases such as, file moved to a different location, file removed, user typed in the wrong URL etc.
Trackback(0)
Comments (0)add
Write comment

security image
Write the displayed characters


busy
Last Updated on Saturday, 03 November 2007 09:59
 

now browsing!

We have 43 guests online

Training

UPK Training

UPK Developer Training Course Description  Overview Understanding Developer menu and toolbar itemsSetting Developer PreferencesManaging FoldersManaging DocumentsCreating Views
+ Full Article

More on Training

Featured

Lorem Ipsum

Lorem ipsum or Lipsum acts as a placeholder for text or graphics in the print and publishing industry. Lipsum is just scrambled text intended to make the reader focus on the layout and design without...
+ Full Article

More Featured Articles

Sharepoint

Creating a custom workflow using SP Designer

Sharepoint has an out of the box workflow that is quite basic and serves well as long as you don't have any conditions to be factored when the workflow is initiated. For example, you may have two...
+ Full Article

More on Sharepoint

Windows

Shortcut to Shutdown and Restart Windows

Tired of using couple of steps to Shutdown or Restart Windows? You can create a shortcut to shutdown or restart Windows by the following steps. Right-click on the Desktop region and select New >...
+ Full Article

More on Windows
 

Sedo - Buy and Sell Domain Names and Websites project info: referpages.com Statistics for project referpages.com etracker® web controlling instead of log file analysis