Customize Your 404 Not Found Page

Last month we took a look at when to use 301 redirects (and when NOT to use them). Many times, a 404 not found page / response is the better option.

However, a generic 404 not found page is not a good thing. Sure, the search engines don’t care either way, but your website is not built for the search engines, it’s built for your visitors…

What’s in a 404?

When a person or search engine tries to find a page on your website, and it does not exist, a “404 not found” code is sent back to the browser/bot, and an optional 404 missing page is returned as well. The 404 code tells the search engine that the URL they are trying to index is not a valid URL. The optional page that is returned is for a visitor to view.

The 404 page is for your visitors. Maybe they clicked a dead link, made a typo in the URL, etc… Whatever the case, the page that comes up can be quite helpful to your visitors to find their way. If no custom 404 page exists, the visitor’s web browser or the webserver will return a generic 404 not found statement:

Generic 404 response

What to have on a 404 page?

404 pages vary from site to site, but some of the more common elements include:

  • Let the visitor know the page/info they were looking for was not found (sounds obvious, but many pages do not do this, which can lead to confusion).
  • Offer a search box so they can search for the item they want.
  • Common navigation links to help them find the right section.
  • A human readable sitemap for quick navigation.

Some sites try to inject a little humor into the 404 page to ease the disappointment of not finding the right page.

Whatever you decide to do, just make sure you do it! It only takes a few minutes, but it can be quite helpful to first time visitors that end up on the wrong page of your site.

404 syntax – get it right

Failure to set up a 404 page correctly can result in search engine problems, broken pages, and confused visitors.

First, identify if your web host has a default page name for a 404 page. If you are hosted with us, we set the 404 page to be “missing.html“.

If you’re not sure if there is a default page, or you want a different filename, you can often set this in a .htaccess file in your main web directory. If you decide to do this, make sure you do NOT include a full http:// URL. For example, to make your custom 404 page be notfound.html, the entry would like:

ErrorDocument 404 /notfound.html

If you put a full URL at the end, this would cause problems for search engines, as they would see it as a valid page instead of a 404.

When creating your 404 page, make sure *ALL* image calls, links, css, JavaScript, etc… are full absolute URLs (i.e. http://www.Your_Domain.com/…). Do not use relative links (i.e. just books.html), as the 404 page will not work if someone tries to go to a link in a folder. This is a common mistake.

The moral to this blog post? Make sure you always create a custom 404 page for your website. Failure to do so will result in alienating potential customers that end up on a default, non-helpful error page.

photo credit

Looking for a web host that understands ecommerce and business hosting?
Check us out today!

2 Comments

  1. Vert Studios says:

    I think it’s important to style your 404 page, that way users know they are still on the same page and they have just stumbled upon a broken page. If they see a default 404 page, they may think they’ve done something wrong and leave your page entirely.

Leave a Reply to Rob Mangiafico