Advanced
Home    About    Contact    Services    Sitemap
eCommerce Marketing & Optimization

What’s Better Than A Custom 404 Page? Redirects To Index On 404’s

eCommerce Marketing

404 is the code a Web server returns for certain pages the cannot be found when access is attempted. It’s what Web users see when they land on a page (usually when following a link or manually typing in a Web address) where the link location has changed, moved, or no longer exists. Webmasters have started using custom pages instead of the default Web server 404’s in an attempt to retain more visits and better serve the user base. Custom 404’s have become a trend over the years as more and more eBusinesses attempt to direct customers, who find pages that cannot be found, to a custom page that keeps users on the site giving them another chance to navigate to a different page.

Default 404 Page Example

There was a post the other day on eCommerce Cache about custom 404 pages that featured 26 different examples of top merchant 404 page designs and features. It features 404 pages from big names like Walmart, GAP, Netflix and more and includes ‘essential elements’ of a 404 page alongside the ‘things you should avoid’ using on your 404’s. The post is in depth and interesting, however I recommend using a different method to direct users who manage to land on a 404 page.

In the EC article, Shannon discusses several rules of thumb for 404’s which includes things like a matching theme to the rest of your site, company name/logo, message about the page, links to important site sections, search function, link to contact page or email and more. She also discussed things merchants should avoid using within their 404’s which include not leaving an explanation, misleading the users, messy or cluttered design and giving users too many options, which may become overwhelming.

I agree with Shannon on all her points and any merchants that currently use 404’s within their design (that don’t already follow those tips) should certainly take her advice. Custom 404’s do work and will help your users to stay on the site longer and gives them another chance to navigate if they happen to land on a 404 page (whether it’s a linking flaw or user error). In my opinion, it’s always better to show users a custom page rather than the default browser 404 page. It’s not that I disagree with Shannon’s points, it’s that I think there’s a better way than remembering all those custom 404 pages rules and spending all that time basically building another landing page.

I prefer using an htaccess redirect back to the index page over building a custom 404 page that explains to users that they are on a 404 page.

As the trend of custom 404’s has spread around the Web, it surprises me to see that so many Webmasters have forgotten about the good old htaccess file, which can be used to redirect users back to index or any other page on the site. With an htaccess redirect, you don’t have to worry about elements of the page to include or leave out, you don’t have to design and perfect another page on your site and it can even be easier to implement than a custom 404 (depending on your platform, hosting and file flexibility).

First, you will need to know that htaccess files can be used for far more than just errordocument redirecting. You can also use them for url rewriting and redirection, among other things. Before you create a brand new htaccess file be sure that you are not already using one within your file system as two htaccess files within the same directory will not work correctly (they can typically be found in the root directory, but may also be within sub-directories). If you are already using an htaccess you will need to edit the current file rather than creating a brand new file for handling errordocument redirecting.

In order to upload or edit an htaccess file, you will need to use an FTP program and a text editor like notepad. Your host may provide you the ability to upload files other than FTP, but you will still need to be able to edit files and upload them to the root directory.

To edit an existing htaccess file, simply access the file on your server, open it to view, copy the code that’s in your current htaccess file and paste it onto a new notepad document. This will ensure that the code you are already using gets included into your new htaccess file. Once you have the code copied, proceed to the section below that discusses creating errordocument redirects for 404’s.

To create a new htaccess file, simply open a new notepad document and save it as .htaccess (be sure you include the dot before the letter H). Once the dicument is saved to your computer, you are ready to include the code and upload it to your server. Proceed to the following step.

Once you have the ability to edit your current htaccess file or have created one for the first time, you are ready to begin adding the code that will redirect users who land on a 404 page back to the site index page (typically the home page). There is a special command line for htaccess files that is meant to help Webmasters handle errordocuments and what users see who happen to land on any errordocument pages.

The command line will follow the following format…

ErrorDocument 404 /filename.ext or ErrorDocument 404 /directory/filename.ext

The command line is added to the htaccess file (ON ONE LINE ONLY) and depending on what directory, filename and file extension is assigned, it will redirect users to the corresponding page on your site rather than showing them the default browser 404 page. You can also use the same method to redirect users to a custom 404 page, or any other page on your site.

An example errordocument redirect to the index page would probably look like one of the following examples, depending on file extensions…

ErrorDocument 404 /index.html
ErrorDocument 404 /index.htm
ErrorDocument 404 /index.shtml
ErrorDocument 404 /index.php

An example errordocument redirect to a custom page would probably look like one of the following examples, depending on directory structure and file extensions…

ErrorDocument 404 /404.html
ErrorDocument 404 /404.htm
ErrorDocument 404 /404.shtml
ErrorDocument 404 /404.php

ErrorDocument 404 /errors/custom.html
ErrorDocument 404 /errors/custom.htm
ErrorDocument 404 /custom.shtml
ErrorDocument 404 /custom.php

Once you have created the file or edited the existing code it is time to save the file and upload to your server. It is always a good idea to backup your existing file before you overwrite it or save over the top of it. You can usually rename the old htaccess file to something like .htaccess1 so that it remains on the server and is easy to name back if something is wrong with the new htaccess file.

Once you have renamed the od file, save your new htaccess notepad as .htaccess (don’t forget the dot before the letter H). Use you FTP program or hosting provider to upload the new htaccess file to the root directory. You should see the new file once it has been uploaded to the server. After you have the file uploaded, open a Web browser and visit your site homepage. In the address bar, after the .com/, add a filename and extension you know doesn’t exist on your server (example would be .com/non-existent-page.html). See what page comes up once you attempt to visit the non-existent page. If you end up on the same page as you included within the htaccess errordocument command, you have successfully created a 404 redirect back to the homepage. If you end up on a default browser 404 page, check the code you have and be sure everything is correct. Common problems may include having multiple htaccess files (causes a conflict), command code on two lines instead of one or you may have failed to include a trailing slash or correct file extension.

Whether you choose to use a custom page or not for 404’s is ultimately your choice. I believe that if you have taken the time initially to create a good homepage design that you probably don’t need to include a custom 404 page and that it would be best to redirect your users back to the index page. It seems like an extra step in the process to me and is certainly a good idea, but just creates extra work and landing page design considerations.

Remember, it is better to have one rather than none at all, so be sure to consider how you handle 404’s when building your eCommerce site.

Article Information

View reader comments...
Like this? Subscribe to our RSS feed or email updates. It's free!
Our Subscribe page has even more ways, including our blog widget.
Article Ratings: 1 - Poor2 - Fair3 - Decent4 - Good5 - Excellent (5 votes, average: 4.2 out of 5)
Loading ... Loading ...
By eCopt on August 6, 2007, last modified August 11th, 2007
Bookmarks: or use Permalink
Read Related Articles In: Usability & Design, eCommerce Marketing, Beginner Guides


Related Articles

Read more articles...

5 Reader Comments & Links

Add a new comment...

August 8, 2007 @ 10:56 am

I don’t usually disagree with you eCopt, but I have to speak up on this one. When we choose to redirect a shopper to the index page (however great it may be), we do not take into account scent. When a shopper requests a page (it can be from a bookmark, an email link someone sent, a stale PPC ad, or whatever…) they intend on anchoring themselves quickly. Anchoring is a quick association between what they expected and what is present. Does the headline match the ad? Does the image match what I had in my mind? If not, they bounce. In the case of a 404, there is a poor anchor. The best we can do is present a friendly message (not an error message - the shopper did not make an error, we did). i.e. You requested XYZ page, and unfortunately it has moved or is no longer available… BUT here is our search box, our categories, and our most popular or highest rated products…. yada yada.

Ideally, the URL structure should give an indication of intent. i.e. www.domain.com/categoryX/missing-product.html

A site can offer up the top categoryX results (sort by highest rated where possible), or do an internal search on the missing-product.html file automatically and do a redirect (301).

With product churn this is common, so really advanced stores can keep record of product URLs and automatically forward to replacement product, or cross-sold product (but always tell the shopper they have been automatically directed to this product because…).

So I do not like sending a user to the homepage upon 404 because there is no anchor. If the resources are available I’d have live chat operator automatically help users who hit a 404 too. Hmm, maybe I should blog this topic too. :)

Reply   Permalink   Latest   Recent   Most   Ratings
Rate Jason Billingsley:   Thumb Up Thumb down  +2
 

August 8, 2007 @ 1:14 pm

Jason, glad to see you comment, bout’ time! I love the discussion you have started here, and agree with many of your points, particularly about visits from bookmarks, outdated SERP’s, email links and a live person chat feature. There are certain cases where a custom 404 page may work better than the index redirect.

First, let me just start off by saying that this post was meant to inform/remind beginner eCommerce Webmasters that there are other options beyond creating a custom 404 page and that once they are aware of both, it’s up to them to decide which method would work best within their business model. I believe I mentioned that for users who already had a custom 404, that the redirect would probably not be the best method for them since much of the work is already done. But for merchants without anything in place, that this would be one quick and easy method for keeping customers who encounter a 404 error on the site.

Many of the things you mentioned about the custom 404 are present on most website index pages, minus the url location and matching anchor related to just that page. eCommerce index pages today look more like portal pages than home pages. They usually have more than 100 outgoing links, they are usually linking to the most important sections, there are a variety of keywords describing the entire product line and there is almost always a search function with appropriate navigation. The only thing missing would be the message informing the customer.

I think as Internet professionals we sometimes forget how much more savvy we are at navigating the Net than the average Web user. An average user, who is shopping online, doesn’t know what a 404 page is or what it means. All they are interested in is finding what it is they are looking for. I have even seen a few rare occasions where custom 404’s have the highest bounce rate out of any other pages. Both of them used custom 404’s that had all of the elements above in place. When they switched the custom 404 to an index page redirect, they noticed the overall bounce rate decreased and overall page views increased (can’t be absolutely proven that it was completely due to the switch though).

I believe there’s no one size fits all 404 page solution. I think depending on the customers you target, your program and website goals that either one is better than nothing at all.

I have seen some pretty awesome things being done lately with 301’s and 404 page includes, and have been experimenting with a few ideas along the lines of what you said about performing internal searches based on the original page file name or title. Can’t wait to discover some new strategies. I liked your idea about live help.

I guess maybe the title of this article was a little misleading. The word ‘better’ should probably not have been used. Perhaps ‘alternate’ would have been more appropriate.

Thanks for the comment Jason. If you decide to blog about this I will definitely join in the discussion.

Reply   Permalink   Latest   Recent   Most   Ratings
Rate eCopt:   Thumb Up Thumb down  +2
 

August 8, 2007 @ 4:24 pm

I guess I forgot my usual ecommerce recommendation disclaimer… test everything. I’d love to see the pages being tested that showed a decreased bounce rate. I guess as an alternative, we could sniff the redirect source and if it came from a 404, simply insert a message into the homepage in a placeholder.

Reply   Permalink   Latest   Recent   Most   Ratings
Rate Jason Billingsley:   Thumb Up Thumb down  +1
 

August 9, 2007 @ 3:40 pm

Well, I didn’t thoroughly test my theory, just posting a personal opinion on this topic. I have seen both ways work well in the past and currently. I’ll see if I can dig up those old files, if they are still on their server.

Reply   Permalink   Latest   Recent   Most   Ratings
Rate eCopt:   Thumb Up Thumb down  +2
 

May 26, 2008 @ 6:03 am

Very interesting article and comments… It got me wondering about redirects and bounce rates: Do redirects (of any form) affect the bounce rate? If I redirect a user from a page that I’m no longer supporting (a free-sample request page) to another (my home page), does that cause an artificial decrease in my bounce rate? How can I account for that in my analyses?

Reply   Permalink   Latest   Recent   Most   Ratings
Rate Russell:   Thumb Up Thumb down  +1
 


TrackBack URI...

Add a Comment

Comments RSS feed for this post...

Name (required)

Subscribe without commenting