Just today, I saw an article that was talking about Microsoft’s intention to update those all-too-familiar “HTTP 404 - Not Found” pages that we all see from time to time while touring the web.

According to the article, Microsoft will be updating their websites to offer a Windows Live Search capability on any 404 page which is generated - so that users may quickly resume their quest for the elusive information they are seeking.

In fact, Microsoft is even releasing a Web Page Error Toolkit to enable developers on MS IIS servers to integrate this functionality into their own websites. (According to the article, the toolkit allows for configuration of the web search engine, to be fair.)

From the picture in the article, it actually appears that the Microsoft solution automatically provides search results - or are those placement ads? That’s one way to ensure your search engine usage rates rise, no? Anything to trump Google, I suppose.

So, in the interest of equal time, here I will go over how I use a simple setting in the Apache web server to achieve nearly the same results, and how you can integrate Google Adsense for Search to become a gazillionaire like me.

Of course, this behavior is not in any way revolutionary, or remotely new for that matter - this is a function that I and many developers have been utilizing in Apache-hosted sites for years. As a matter of fact, it is one of the more simple usability updates you can make to a site you host, and it keeps visitors from leaving in frustration over a typo’d link or moved directory, which happen more often than we developers like to admit.

So, how do we implement our own customized 404 error page (or any of the myriad other errors that can come up), complete with search functionality to help our misrouted visitor find the proverbial cheese?

Let’s create a Google Search Page

Most of the heavy lifting here will be done by Google Adsense, after logging into your account you will want to choose Adsense Setup - Adsense for Search. There aren’t too many options, mainly you need to choose if the search should extend to the entire web or not, and some color choices which will be completely dependent on your theme.

At the end of the process, Google will create a code block which you can insert to your pages. This code will create a Google search form with the settings you specified.

Now, let’s create a simple HTML page which will house our Search form, while gently breaking the news to our visitor that we were unable to fulfill their request. But, we don’t stop there; also, we provide our visitor with some choices as to where to go next.

Generally, in addition to the search form, you will want to include links to the website home page, as well as a site map or index if one is available. Also, it is very helpful for many users if you also give them a few ‘pointers’ on how to successfully search for the information.

Consider the following (the code for this ultra-simple search dialog is below):



404 Error - Page Not Found

Your Request Could Not Be Completed

The Document or Resource that you were looking for could not be found, it could be that you mistyped a URL or followed an outdated or incorrect link.

Where to go from here

  1. Check the URL if you typed it yourself.
  2. Visit the Site Index to find what you are looking for.
  3. Visit the Home Page, or use the navigation links to the right.
  4. Search for what you were looking for below:

    Google Search

    A few ways to find what you are looking for faster:

    Search on a specific site
    Add "site:<website address>" to your search query.

    For example: "edu-nix site:wikipedia.org"

    Search for a specific file type
    Add "filetype:<file extension>" to your search query.

    For example: "edu-nix filetype:pdf"



Okay, so now we have a simple, generic search page that we can provide to our users who have lost their way. Save this file as ⁄not_found.html, for example.

Enter .htaccess

Perhaps one of the most mythologized and misunderstood configuration files in all computing, the Apache .htaccess file is where all of the magic happens.

Open up the .htaccess file in the root directory of your webserver (often www or public_html) with a regular text editor such as Notepad, or Kate, and add the following line:

ErrorDocument 404 http://www.yoursite.com/not_found.html

Now, whenever Apache receives a request it cannot fulfill due to a 404 error, it will instead send your visitor to your fresh new Search page. Really, that’s it.

Try it out, head on over to www.shopholbrook.com/gobbledygook for an example of how a user-friendly site can provide their visitors with the capability to solve their own problems.

Look Ma, No Monopolist!


(This was a 15 minute quick lesson, look for more information at sites such as A List Apart for further discussion and ideas.)

Code Listing:

<h2>404 Error - Page Not Found<⁄h2>
<h4>Your Request Could Not Be Completed<⁄h4>
<p><em>The Document or Resource that you were looking for could not be found,
it could be that you mistyped a URL or followed an outdated or incorrect link.<⁄em><⁄p>
<h4>Where to go from here<⁄h4>

<ol>
<li>Check the URL if you typed it yourself.<⁄li>
<li>Visit the <a href="⁄sitemap.php">Site Index<⁄a> to find what you are looking for.<⁄li>

<li>Visit the <a href="⁄">Home Page<⁄a>, or use the navigation links to the right.<⁄li>
<li>Search for what you were looking for below:
<form method="get" action="http:⁄⁄www.google.com⁄custom">
<fieldset>
<legend>Google Search<⁄legend>

~!!!HERE IS WHERE THE GOOGLE SEARCH CODE GOES!!!~

<dl>
<em>A few ways to find what you are looking for faster:<⁄em>
<dt>Search on a specific site<⁄dt><dd>Add "site:<website address>"
to your search query. <br ⁄>
For example: "<em>edu-nix site:wikipedia.org<⁄em>"<⁄dd>
<dt>Search for a specific file type<⁄dt><dd>Add "filetype:<file extension>"
to your search query.<br ⁄>
For example: "<em>edu-nix filetype:pdf<⁄em>"<⁄dd>
<⁄dl>

<⁄fieldset>
<⁄form>

<⁄li>
<⁄ol>

Who’s the Next UPS Spokesman, Roger Clemens?

United Parcel Service (UPS) has recently announced their marketing deal with the owners of horseracing triple-crown contender Big Brown, despite public admissions by the horse’s trainer Rick Dutrow Jr. that he injects Big Brown with the steroid Winstrol monthly:

A week before Big Brown bolted out of the gates at Churchill Downs from the outside post and raced to a thrilling Kentucky Derby victory, the colt’s trainer Rick Dutrow Jr. revealed a little secret.

“I give all my horses Winstrol on the 15th of every month,” Dutrow told the Daily News. “If (the authorities) say I can’t use it anymore, I won’t.”

Perhaps the most appalling aspect of this story is the fact that this barbaric behavior, doping of race horses, is legal in many states here in the United States of America, including my hometown of New York.

Anyhow, if you have a moment and feel similarly about this behavior, you can let the folks at UPS know how you feel. Tell them to stop supporting any racing organizations that allow these practices.

Perhaps through pressure on corporate sponsors, especially in the run-up to the final race of the triple crown, we can affect some change.

(I would love to find a link to the NY racing commision as well… Gone Googling, be back later…)

I had alluded to it a few days ago, and here it is: now available for download, the beta version of the next EDU-Nix Dual Mode CD: Mobile Office Edition v6. WooHoo!

This CD features a Linux Live CD Environment based on Slax 6.0.6, and includes the OpenOffice.org productivitiy suite (spreadsheet, word processor, presentations, formula editor, etc), Scribus Desktop Publishing, KMyMoney personal finance manager, as well as Krita and Karbon for graphic and image creation and editing.

The CD also includes the OpenClipart collection, which enables you to be instantly productive out-of-the-box, so to speak.

Within the Live CD Environment, the OpenClipart is linked into the OpenOffice.org gallery:

  1. Click on the EDU-Nix K-Menu icon
  2. Office -> Word Processor
  3. Insert -> Picture -> From File…
  4. You will be presented with folder categories of the available clipart, ready to jazz-up your documents and presentations.
  5. Enjoy the clipart.

In addition, the Live CD Environment also provides a Web Browser, Instant Messenger and even a Network Folder Wizard which enables simple access to available shared folders and ftp servers. Also available are the KPlayer multimedia player, KSudoku and Patience (solitaire) for the occasional diversion from the drudgery of typing.

Oh, and did I mention that each of the productivity applications - OpenOffice.org, OpenClipart, and Scribus Desktop Publishing are also included on the CD as Windows installers? In addition, the V6 CD includes the PDFCreator virtual printer, which allows Windows users to create PDF files from just about any program they can print from.

Just drop the CD into your Windows PC and execute the autorun.exe file if your PC is not set to autostart, then select the program you would like to install from the list and click “Install Now”. This way, you can be assured that your documents you work on on your home or school PC are completely compatible with your Mobile Office CD.

In short, the Mobile Office CD hopes to include all of the tools any student could need to research, create and edit papers, reports and projects - at home, at school and wherever else they can ‘borrow’ a PC, and be assured they have unfettered access to the same necessary software anywhere, anytime.

Never again will a student be frustrated that their version of Word is too old to edit their report from school, nor learn the hard way that MS Works is not quite the same as Office. OpenOffice.org is free to use for any purpose, legally redistributable, and compatible with every major office suite and document format, including the OpenDocument standard which provides for future-proof interoperability and access to your information.

So, if any of the above features interest you, please test it out and let me know what you think.

Site development has just begun in earnest, it will take a bit to get everything in order. In the meantime, feel free to browse some of the projects that I am currently working on…

EDU-Nix.org Open Source Schoolware

Over at EDU-Nix.org, I am about to release what is being called the Dual Mode CD Version 6 - Mobile Office Edition, which is Linux Live CD built on Slax 6 and features OpenOffice.org 2.3, Scribus Desktop Publishing, the OpenClipArt library and more.

The Mobile Office CD will allow a student to create and edit Graphics, Presentations, Spreadsheets, Word Processing and Desktop Publishing projects from virtually any PC without the need to install software to the hard drive - students can take their workstation with them and work on their school papers and projects, anywhere they can gain access to a PC.

To ensure total compatibility between school and home computers, the CD also includes installers for Windows versions of the productivity software as well, allowing teachers and students to install the same software on their home PC. In addition, OpenOffice.org is compatible with every major Office Productivity suite and document format, and also provides integrated one-click export to PDF.

And, most importantly, the software is Free - as in cost, as well as Freedom. The license of each of these programs is such that redistribution is not only permitted, but encouraged! If you find this software useful, perhaps a friend will as well.

Go ahead, burn a copy for every student in your class. I’d be honored.

ShopHolbrook.com

Locally, I am working on a website called ShopHolbrook.com. The idea is to create a community-based site that will allow for local businesses to be freely indexed and findable on the web for local residents and my neighbors as well as a discussion forum for consumers.

The site is still under some construction and design, but has been steadily gaining word-of-mouth popularity - enough to garner a few Featured Listings already - I have yet to advertise the site in any way, but am planning a potential targeted mailing or advertisement in the near future - sometime this summer, perhaps.