How to set up a Custom 404 File not found page
September 3rd, 2008Sometimes we found that a user encountered the frustrating 404 error page while clicking on a link to a page. It may be due to the fact that the page has been deleted or no longer available on your site, the customer mistyped the link Url etc. At this time your server returns a HTTP status code of 404 to indicate that a page is not found.
In this case the users will do the following :-
# Click on the BACK button of your browser and go somewhere else.
# Try to back up one directory in the URL and try again
# Write to the webmaster of the site and the referring site to inform them of the situation.
So you should do something as generic messages can be frustrating to the user & potential user may just leave.
The error code should be customized with a page that apologises for the mess up & provide more useful information about your site. A good custom 404 page will help people find the information they’re looking for, as well as providing other helpful content and encouraging them to explore your site further.
Process :-
Now, the creation of the custom page itself isn’t difficult. It is just another HTML file saved with any name you want it to have. To get your custom page to show up on a 404 error requires a little extra work.
For technical information about configuring your server to show your custom 404 page, choose the type of server your site is hosted on:
Apache
WebStar
iPlanet Microsoft IIS
Roxen
thttpd Lotus Domino
Netscape Enterprise Server
Don’t know your web server? Try NetCraft. Enter your domain, and it will tell you what webserver it’s running.
1st Method
To begin, go to the main directory of your web site (where your main page is located) through FTP or Telnet. Look for a file there named .htaccess, it begins with the dot as though it is a long file extension. If you have the file, you will want to edit it. If you do not have the file, create a new text file and save it as “.htaccess”.
If you are creating the file from scratch, simply type the following line into the file, changing the url to the location of your custom page:
ErrorDocument 404 http://www.yoursite.com/custom_page.html
Keep it all on one line, with a space on each side of the number 404. Also, this is case sensitive, so be sure to check the case of the E and D in ErrorDocument before you proceed.
If you already have the file and need to edit it, look for a line like the one above. If it is there, you can just change the url. You may want to ask your web host before doing this, just in case. If you do not have the line, add it in after everything else on its own line.
When you are done, upload your new .htaccess file to the server. Then, be sure to use the CHMOD command through your FTP or telnet program to set the permissions to CHMOD 644.
Also be sure that you have uploaded your custom page to the server, otherwise you’ll get a 500 server error or something similar. Once that is done, you can test your new error page by typing in a url that you know does not exist on your server. You should get your custom page, ready to bring in the lost visitors that may be out there.
Second Method
First, open up Internet Service Manager and right click on the website that you want to set the custom 404 Error for. Click on Properties and then choose the Custom Errors tab. Scroll down until you get to the 404 HTTP Error. You’ll notice on the right that it has the filename that is associated with the 404 status listed. You can edit this file directly, if you like, or choose a new file (by choosing Edit Properties).
Examples of custom 404 pages
Ex -1 : Sorry, the file you were looking for could not be found. It may have moved to a new location. Please use the navigation to the left to help you locate the file. You can also search for a file by using the Search Page at this site.
To go on to the main page of this site, click the link below:
manuallysubmit.com
Ex-2 : Sorry, the site you requested was not found. Please check the URL for proper spelling and capitalization. You may find what you’re looking for if you try searching below, or, if you have some issues with SEO Services you might well want to go check out manuallysubmit.com.
In addition, you can add the 404 widget to your custom 404 page. The 404 widget automatically provides users with helpful suggestions instead of error messages
Because a 404 page can also be a standard HTML page, you can customize it any way you want. Here are some suggestions for creating an effective 404 page that can help keep visitors on your site and help them find the information they’re looking for:
• Tell visitors clearly that the page they’re looking for can’t be found. Use language that is friendly and inviting.
• Explain the error that has occurred, and perhaps describe common reasons for the error (mistyped URLs, outdated content etc.). Use clear language and don’t ramble.
• Your 404 page should look similar to the rest of your website, so that visitors know that they’re still on part of your site.
• Consider adding links to your most popular articles or posts, as well as a link to your site’s home page.
• Think about providing a way for users to report a broken link.
• No matter how beautiful and useful your custom 404 page, you probably don’t want it to appear in Google search results. In order to prevent 404 pages from being indexed by Google and other search engines, make sure that your web server returns an actual 404 HTTP status code when a missing page is requested.
• If your site has a search function, include a search box.
• If you have an index, add a link to it, and definitely link back to your homepage.
• Include an email link so that visitors can report the problem. Don’t expect a lot of them to take the time to do it, but some will, and it again enforces the point that you care that they’ve had a problem.
Overall, just make sure you motivate your reader not to lose all faith in your site, and give them options as to where to go next.