15. No 404s

HTTP requests are expensive so making an HTTP request and getting a useless response (i.e. 404 Not Found) is totally unnecessary and will slow down the user experience without any benefit.

Generally web server returns an “error 404″ page when a browser is looking for a page that doesn’t exist. This can occur for the following several reasons

  • Broken links. Such as when a typo occurs, as in “about.htm” vs. “about.html.”

  • Missing links. This occurs when pages are removed or renamed, affecting internal and external links.

  • Domain name changes. For example, changing from “www.companyA.com” to “www.companyB.com.”
No 404s

Guidelines:

  • Create a custom “error 404″ page. This helps to capture the web visitors and prevent them from becoming discouraged when they click on the missing or broken link. A custom 404 error page provides a solid foundation for holding onto your potential customers.

  • Implement 301 redirects. 301 redirects automatically link an old page to a new one. I’ll address this process in “Part 2.” Custom 404 error pages will not work unless the old domain is still active and is redirected — via a 301 redirect — to the new domain.

Fixing bad requests is a lot easier than finding them. If you find you have one or more, just remove the code that is calling the resource, or replace the missing resource.