Bing 404 Web Error PHP Toolkit

Documentation updated 16 November 2009

For complete documentation please refer to the /doc folder after unziipping the downloaded package.

Welcome to Bing Web Error PHP Toolkit!

Everyone has encountered the frustrating 404 error page. You follow a link, looking forward to the joy waiting for you on the other side, when BAM! you get an error because the page you were looking for does not exist. Maybe it was moved, maybe it was never there in the first place, but the fact is you’re left sitting there with an unhelpful error message and nowhere to go.

The best sites have found a way to lessen the aggravation by customising their error code with a page that apologises for the mess up and offers some solutions to rectify the problem.

Brief Description

The Toolkit is a customizable PHP application that replaces the default error page on your IIS or Apache server. The process works as follows:

A user's browser sends a request for a page that no longer exists at the request URL.
Your server identifies a 404 and executes the Toolkit.
Toolkit extracts keywords and renders them back to the user's browser.
User's browser sends a request to Bing API.
Bing API returns appropriate results to user's browser.
User's browser renders results in the context of the page that you have customized.
Bing Web Error Page — Workflow
Customize your 404 error pages with the Bing API Web Page Error Toolkit.

For large web sites with extensive amounts of content, 2 to 10 percent of traffic is looking for pages that either don’t exist or have been moved. Most web servers return a generic 404 error page or a sitemap when a user’s desired page cannot be found. These unhelpful pages often result in a dead end for users.

With the re-architected, easily deployed Web Page Error Toolkit, you can create dynamic 404 pages that contain customized error messages along with search results seeded with relevant keywords to help your users move past the missing page and find the information they need.

The Toolkit is a customizable PHP application that replaces the default error page on your IIS or Apache server. The process works as follows:

Server-Side in PHP:

  1. A user's browser sends a request for a page that no longer exists at the request URL.
  2. Your server identifies a 404 and executes the Toolkit.
  1. Toolkit configuration is setup as follows:
    1. web.script.xml holds all Server-Side, Client-Side, and Bing Search settings.
    2. web.script.xsd maintains XML Schema for validating key settings within web.schema.xml.
    3. cache/web.schema.json is a snapshot of both web.script.xml and Bing Assets' values.
  1. Bing Assets is an XML document containing URL locations of Bing related icons, logos, and URLs:
    1. Ref: http://api.bing.com/brandassets.xml
  2. Toolkit extracts keywords and renders them back to the user's browser as hidden HTML values.
    1. web.script.xml contains several keyword extraction strategies available to customize your site's utilization Bing search.

Client-Side in JavaScript:

#From hidden HTML values, builds URL with JSON (Bing API 2.0).
  1. Ref: http://msdn.microsoft.com/en-us/library/dd250846.aspx
  1. JSON URL is embedded with a Client-Side JavaScript callback, which is called upon response from Bing search request.
  2. JSON URL is sent to Bing's JSON endpoint:
    1. http://api.search.live.net/json.aspx?
    1. Bing API returns appropriate results to user's browser.
      1. Errors
      2. Web
      3. Spell
      4. Images
      1. User's browser renders results in the context of the page that you have customized.

The Toolkit enables you to use the Bing API to return results for the specified domain and locale, control the number of results returned on your page, choose whether to offer spelling corrections, and customize your error message.

You also have the option of choosing from several keyword extraction strategies that are included with the install, or providing your own implementation.

Last edited Nov 17, 2009 at 3:07 AM by suchawla, version 1

Comments

Khokan333292 Nov 22, 2009 at 6:32 PM 
I fill lucky to get the code plex. http://www.salahuddinlawassociates.org