Working With 404 Pages

I’ve been working on a new not found page (404) for the site I develop for. When I enabled logging of 404’s on our old page, we were flooded with reports of broken links. I decided that it would be easier to create an entirely new page than to salvage the old one. This new page is divided into three parts.

Quick Info
The header (h1) text of this page says “We’re sorry, the page could not be found,” because a user shouldn’t need to know what a 404 is (Do you think the average user cares that the first four signifies a client error? S/he just wants the page to work!). Most users can quickly recognize the page as a “not found” page, so they just want fast links. The first two sentences are a brief explanation of the problem (with the requested file in parenthesis in case the user is able to quickly see a typo) and are followed by an unordered list with three links: main page, sitemap, and search page. If the referring page appears legitimate, that page is also linked in the unordered list.

Search
Using a Yahoo Search class I recently wrote, the 404 page automatically breaks down the requested URL and grabs the file name or most relevant folder and does a search (making conversions such as underscores and hyphens to spaces in order to make the results more relevant). The search automatically excludes the bad link from the results (unfortunately, we have to rely on Yahoo for our search currently, so I didn’t want to have Yahoo give a bad link, which is followed to the 404 page, which then displays the bad link again in the search results). If any results turn up, the top three are shown. If not, the whole auto-search section is not displayed. If there are more than three results, the user is given a link to our actual search page with the query string attached.

Why?
I decided to include the more detailed explanation portion last, because most people either already know about error pages or don’t care. Those users can quickly use the links or search results to find what they are looking for. Those of us who are excessively curious can read the customized “why” section. Depending on the situation (a bad link that’s our fault, a bad link that’s someone else’s fault, a directly typed address), a specific explanation message is included. All of the messages inform the users about our “Comment on this page” ability, so they can submit additional information if they would like. Regardless of their choice, any bad links that originate on our site are automatically submitted to Trac (our SCM/Project Management tool).


0 Responses to “Working With 404 Pages”

  1. No Comments

Leave a Reply