CodeBitch : click here to go to MacEdition Homepage

I like pain, but Web surfers don’t (or, When the Mistress is away, the slaveboy comes out to play)

24 August 2000

Pssst ... CodeBitch is away treating her harem to Parisian sights, so I think it’s okay for me to talk for a little while. She gets upset when I speak out of line, so don’t tell her I was here, okay?

Oh, I forgot to introduce myself – I’m Johnny. As CodeBitch’s slaveboy, I assist her in HTML and other Web site-related tasks (and some other stuff on the side). Now, my mistress has been focusing on code; I want to talk about putting that code to work in making a friendlier site.

I don’t want to get deep into the science of interface design at this point, so let’s start a little further out. Listening to user feedback is the surest way to grow a functional Web site that gives visitors the information they want with as little pain as possible. Given this, what are the mechanisms that you can employ to generate useful communication between your customers and yourself?

I’ve been a bad link

One thing worth addressing is the bane of the Webmaster – broken links. Even if you use a WYSIWYG editor/site manager such as Dreamweaver or GoLive, bad links are unavoidable as you delete, move or rename pages that are still linked from search engines, or fail to keep your site in sync with the copy on your workstation. And the problem grows exponentially with the site.

Of course, the best policy is to start with a logical naming scheme and to never delete, move or rename pages. But what if: you inherited a mess of a site; the company just changed product names (and therefore page names); or you just realized that naming each page by number wasn’t such a good idea?

The easiest thing to do is, in place of your nonexistent page, leave a simple page that redirects the user to the appropriate page. If you want to do something a little more polished and have access to your web server’s setup, you’ll use server-side redirects. These let you catch the request for a nonexistent page at the server, and the server will serve the correct page without the user ever noticing.

But you can’t catch and account for every mistake before the users find them, so you need a way to let anyone who stumbles upon a broken page notify you. Many sites have a generic “404 error” page with the webmaster’s email address for notification. However, to write a message pointing out a broken link is too much trouble for most people perusing your site. In addition, this doesn’t give you, the webmaster, enough information to fix the problem properly. If you want to be proactive and correct the page that contains the bad link (instead of merely adding a redirect to the proper page), you need the URL of the referring page as well as that of the requested page.

Whip it into obedience

So let’s make this easy for everyone, and make a one-click form (hey, Amazon, don’t sue me!) that reports the error and the referring page to you. (Check out ours here.) You won’t be able to do this unless your Web server can do server-side includes (SSI) and email forms (using a CGI such as CGIEmail), so get your sysadmin a case of Mountain Dew and ask him or her nicely to set these up.

You may already have an error page named something like “missing.html” or “404.html”, which you can use as a starting point. First, set up an email form on the error page that sends a email to you. You don’t want to scare away your potential bug reporter with an eye-glazing form, so all the information you need will be in HIDDEN form elements. (If you want, you can add a visible text field for the user to enter their own address to be notified of the fixed link.)

Now the magic of SSI comes in. You don’t need to ask the user what page they’re looking for or the page they’re coming from – that information is hidden in the HTTP header sent back with each page a browser requests. To get the URL that’s missing, insert this into your HTML:

<!--#echo var="REQUEST_URI" -->

And to get the URL that the user was on previously, use:

<!--#echo var="HTTP_REFERER" -->

Use these to populate HIDDEN variables with the requested URL and the referring URL. Then you can set up the email form to include these in a nicely formatted email sent to you. (And as long as you’re working on the error page, don’t forget to add a link to your sitemap or search page to help the customer get where they were trying to go.) You can view our error page in all of its naked server-side glory here (you may have to View Source if your browser renders this as HTML).

Tie it all up

This is just one way you can be responsive to your site’s visitors. It seems like a small detail, but the most important thing you can do is to listen to your customers’ feedback using every possible channel. And make that feedback easier to give – consider that for every person that does communicate with the person behind the scenes, there are probably 20 who don’t. This makes compliments that much more appreciated, too. Lord knows my Mistress doesn’t give them out very often.

... and I think I hear her coming. Maybe I’ll be able to sneak out to talk to you again, but for now I’ll just crawl back in here. Remember, you didn’t see me here, okay?

— Webmaster by day, slaveboy by night, Johnny just can’t get enough punishment ... so let him have it at johnny@macedition.com.

E-mail this story to a friend