A More Useful 404

by Dean Frickey

56 Reader Comments

Back to the Article
  1. I agree with bill that 404s are bad for SEO – however 301-ing all 404s to a single other pages isn’t quite optimal either. The optimal (if sometimes unattainable) experience would be for any old page/URL to get 301 redirected to the new/working page that is most applicable to the old page.  This is really common when our clients move to a new CMS for example.  The old pages (the content of them) are still on the new site, but all at new URLs.  We’ve actually done this so many times we built a tool called www.errorlytics.com that does exactly this quickly and easily for sites running PHP, JS and Rails…and has Wordpress and Drupal plugins/modules.  The idea of the tool is to 1) make you aware of the often ignored 404 and 2) make it so you can get rid of them via 301 redirects thus preserving SEO and the end user experience.

    The key edge that Errorlytics offers over tools like, for example, linkgraph is that it allows the webmaster not only to ultimately get the user who has requested a bad/dead URL to get to a page that has some content on it – but Errorlytics does this via an SEO friendly 301 so even the spiders are happy.  Using a frameset and a meta refresh is far from optimal on the SEO side.

    Copy & paste the code below to embed this comment.
  2. Steven, I just tried to mimic .htaccess and php, and for me $_SERVER[“SCRIPT_URI”] returned URL of the page user asked for. You can temporary send your 404 to a .php page with

    <?php phpinfo (); ?>

    then go to any not-existing webpage in your website, 404 page will show PHP info page, just examine the variables it shows and I’m sure you will find webpage you entered, not only name of 404 script. Just do not forget to restore 404 to your original script after fixing the problem.

    Copy & paste the code below to embed this comment.
  3. I have now implemented a similar system to this in PHP. Thanks for the interesting article gave me some great ideas.

    Copy & paste the code below to embed this comment.
  4. So many requirements for error page 404. Interesting visits statistics of page 404 in percents. I’d like to see examples of 404 pages. For self I choose this functionality of 404 page http://www.kontain.com/bickov/entries/36756/page-404/

    Copy & paste the code below to embed this comment.
  5. I have been developing web sites for a number of years now and I am always surprised at the lack of attention paid to 404 pages by both developers and designers. I have always harvested 404 data and was very pleased to find this article and see that there are web developers and designer out there that understand how the “404” should be used to teach us about issues our end users are encountering.  This technique has saved my shame and insult because I can proactively find issues.

    Copy & paste the code below to embed this comment.
  6. How can you translate the plugin to another language?

    Thank you.

    Copy & paste the code below to embed this comment.