404 to Search Page
Comments: 12
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
Posted by Alexander 2009.08.10, 11:50
ola valette de kumba faba
Posted by Pol62 2009.10.11, 05:43
Other public service programs like neighborhood baby clinics were systematically denied any funding. ,
Posted by Merlin37 2009.10.23, 00:22
A context is referentially opaque when a substitution of one co-referring term for another yields an invalid inference. ,
Posted by John30 2009.10.23, 22:00
When analyzing the problem of youth participation in the Balkans, one should be aware that contrary to the developed Western countries, we are talking about a substantial part of the overall population. ,
Post a comment:
Send This Story to an Enemy
• • •