404 to Search Page
Comments: 8
When you try to access an address on a site that doesn’t exist, you get a 404 error. What you should get is an attempt to find the page you’re after and, if that doesn’t work, a search page where you can enter a string of your own devising. Thanks to this ingenious PHP snippet from Erik Barzeski that’s exactly what you can offer wayward visitors to your site.
I know I’m a bit late to the party with this one — Erik posted this back in February but better late than never when it comes to improving 404s.
•••
Posted to Computers • 2003.05.20 (Tue) • 23:50
Comments
Posted by Ian 2003.05.21, 00:18
There are a couple of issues with doing this which you might want to be aware of.
Posted by Erik J. Barzeski 2003.05.21, 07:16
Those “issues” as others have pointed out are not things that couldn’t be done anyway - repeatedly querying mt-search.cgi and so on.
Posted by Jon 2003.05.21, 14:23
I have implemented said script over at MobileTracker.net and will do so for ">News Is Crappy as soon as I get around to it.
Those people who said it’s easy to DOS with are insane. Just make a search query, note the URL. Bomb like hell. All the script does is make errors friendly…
Something that should always be done if possible.
Posted by eliot 2003.05.21, 14:42
I’ve been doing this for months.. I didn’t realize it would be so popular, or I would have published my script as well. I basically yoinked some code from my MT-RefSearch script to provide users with helpful 404 pages. Since I switched my blog’s archives to use the path format (yyyy/mm/dd/entry_title.php) rather than the MT default (004578.html), I also included code to find the new location of those entries.
I wish big sites had more helpful 404 pages like bloggers are using. Motorola is a wonderful example because I run into dead links on their site nearly every day. I just want the content!
Posted by amd 2005.09.21, 14:44
yeah, motorola is filled with dead-links, but they should do something to show the old pages you are looking for, not just helpful 404.
Posted by sarah palin 2008.09.04, 04:14
Posted by myxrumerrtr 2008.09.18, 03:08
Posted by kuper 2008.09.18, 05:42
18Dxa6 hf6Snb9Ula10Hdf74n
Post a comment:
Send This Story to an Enemy
• • •