Useful 404 page
I read an article on A List Apart about creating “A More Useful 404”. I also think that it’s important to give better feedback to the visitor who ends up on a missing page. But I think that the customized 404 page should differ remarkably from the original site layout so that there’s no doubt about you’ve ended up on a “missing” page. I’ve seen 404 pages that are impossible to tell apart from the site and it can take quite some time before you realize you’ve reached a dead end.
I’ve used a customized 404 page on our sites at work almost since day one. The feedback to the visitor can be better but I have an email function – like suggested in the article at A List Apart – that sends an email to me, telling which URL the visitor tried to access and which URL the visitor came from, when someone reaches a missing page from a link, internal or external.
And I must say that this function is really, really helpful. If the broken link is on another site I usually send them an email notifying them about the problem and giving them the correct link – sometimes you just need to re-structure your site, even though it should be avoided when possible – and mostly they appreciate it and alter their link immediately. Also, when re-structuring, it’s easy to miss a few of your own internal links and with the little email notification the problem can be fixed right away.
In Roxen (the CMS we use at work) terms, all that needs to be done is adding this little snippet to the 404 page template in the administration site, under the “settings” tab for the site in question.
- <email to="you@your-domain.com" subject="Error 404">
- Requested URL: &page.virtfile;
- Referring URL: &client.referrer;
- ---
- UA: &client.fullname;
- </email>



This is a very good thing tip.
Thanks Matt!
The small e-mail snippet has fixed alot of headaches when a restructure has been necessary. It’s easy to miss a few internal links here and there. But that will hopefully be solved with the new Link Manager in Roxen 5. Haven’t had time to upgrade on any production server yet but Roxen 5 is a real improvement I think.
Good luck with the Open Source Days!
You should be a little bit careful when sending e-mails for every each invalid access. Badly behaving bots may potentially generate lot of emails flooding your e-mail account; therefore you should use some way to ban requests from repeatedly recurring IP-addresses. Besides that, this is a good idea. I have used it for years and it has proven to be an efficient part of my workflow.
A nice feature to throw into a customized 404 page, is a link to search the site for the words from the bad URL. This will help the user to find the right place easier.
You have a good point there Martin. We haven’t had any (major) problems with badly behaving bots. Actually I found one search engine spider that treated
text/cssin arelattribute as an URL. I notified them about this and they seem to have fixed that issue.In the next iteration of our web site I will try to put some effort into the 404 pages
You may need to remind people that a reply address needs to be either in the module or specified.
re: bots, I get them filling out forms all the time until I set up gbutton turning test.
btw, Open Source Days produced a potentially interested customer for yakity chat… weee!