A better 404 page
Most 404 pages say something along the lines of "We can't find that. Sorry." Offering search is better, if people know what to search for. If you're coming from a shortened link, or didn't pay attention, you may not know what to search for. I tried to improve upon the old design of "We couldn't find what you were looking for, so please search for the thing you don't remember."
A 404 page should do at least this much:
- Tell the reader that the page they tried to visit couldn't be found
- Give them a way to find it
- Tell them how they got there, in case that provides clues for searching
Here's what it looks like in action and the PHP code behind it: