Customizing 404 error pages (on WordPress blogs)
If you’ve ever seen a 404 error (“not found”), you’ll relate to the frustration that users experience when all they get is a “Sorry, can’t help you” type of message.
That’s why I’ve customized the 404 errors on Frederick’s Timelog to be a bit more user-friendly.
If you go to any random non-existent page (for instance, http://www.frederickding.com/posts/234u0af) you will come up against a 404 page with an evident error. The red background immediately indicates a problem, while the blue section indicates possible remedies.
On a random URL, the possible remedies are limited to a site search. However, if you go to a misspelling (for instance, http://www.frederickding.com/podcasts as opposed to http://www.frederickding.com/podcast), there’s a neat feature that says “Go to [the correct URL]“.
How was this accomplished? (Code samples follow after the jump.)


