About The Author

I am a search marketing geek. Work as APM for one of the leading companies in UK. Interested in socializing and helping others.

Get The Latest News

Sign up to receive latest news

November 25, 2008

Custom 404 Error Page

What is 404 Error Page?
The 404 Error Page or typically speaking the "PAGE NOT FOUND" error message is an HTTP standard response code, which indicates that the user was able to communicate to the server, but either the server could not find what was requested, or it was configured not to fulfill the request.

In simple language it's that when you encountered a website and clicked a link just to gather more information but you see a frustrating 404 error as page not found. Other ways of getting this error is like you are a frequent visitor and you know a particular URL of the website, and when you entered that the page not found message displays, because either the page is not there or it's address is changed.

The 404 errors reveal that the server is there and it should not be confused with the SERVER NOT FOUND error, where the destination server cannot be found.

What is a Custom 404 Error Page?

Now, we can talk more about the 404 Pages in SEO point of view. We have a website and we have a visitor to our site. But somehow the visitor is not able to see the information or the web page on to the website, and thereby he is taken to the standard 404 error message, as to Page not Found, which looks something like

Not Found

The requested URL /test.html was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/ Server at www.yourwebsite.com Port 80

which obviously is not at all appealing to the users. So you can create a custom error page for your website in order to retain the visitors, who may leave if they get the standard "File not found" page.

A custom error page is a page which consists of some important links to the website, or a search box to search the website, a funny message or anything. It typically shows and provides visitor the information which he/she may be interested into. An example from BBC.com showing the Custom Error Page.

How to Create a Custom 404 - Error Page?

The first thing which comes into notice is weather the web host of the website provides the facility to customize the page or not. It can be done by checking the .htaccess file of the website and that weather it can be customized or not. If yes then you can modify the file in order to create the customized 404 error page. The .htaccess is typically the configuration file for the Apache Server.

The following steps should be considered in order to create the custom 404 error page,
  • Updating the .htaccess file
  • Creating your custom 404 error page
  • Testing the page

1) Updating the .htaccess file
If you are not using the Apache Server configurations then you need to find out from the web host, as to what you need to do to enable the server to serve your customized file when a file cannot be found. Other than that, i.e., for Apache check out the file called as .htaccess, if its not there then you can create one.

Open notepad and save the file as .htaccess, make a note of it that the file name extension should be preceded by a dot. This files tells the server about the website.

Open the .htaccess file with any text editor and add the line as it is, with all spaces and same format

ErrorDocument 404 /pagenotfound.html


ErrorDocument - informs the Apache server that when ever it is not able to find the files in the directories or the sub-directories of the site, then it will show the proceeding URL document. The point to be noted here is the 'E' and 'D' should be used in the same format without any space. This is case sensitive.

The .htaccess file will do the work and display the custom error page, but in case you need to display another custom error page for sub-directory, then you just need to place another .htaccess to that partcular sub-directory, with different custom page.

2) Creating your custom 404 error page
A Custom 404 Error Page is another html page on your website. There are the following things which can be considered while creating the custom error page,
  • The Custom Error Page should look similar to the website,
  • It should use clear language to notify the error,
  • It should provide a link to the HOME PAGE, and a link to the Sitemap, telling the important pages of your site,
  • The page should provide a search box if the website offers search feature,
  • There should be an e-mail address, for the visitor to report the problem.

3) Testing the page
In order to test the page, just type the URL in the address bar which is irrelevant, and you will see that your error page is loaded.

Note that, don't forget to upload the file in the root directory of the server.

You have worked so hard in creating a website, and then maintaining it. It would be too weird that a visitor comes and only because he cannot find the information he was looking for on your website, he went off. By creating custom 404 error page, it's really helpful to retain your visitor and increasing the chances of getting more visibility.

You may also be interested in reading the following,