Ecommerce, SEO, and 301 Redirects

301I recently came across a great blog post titled “Surviving and Thriving as an Ecommerce SEO“. It’s a great read for any ecommerce store owner that is interested in optimizing their store in terms of search engine rankings. The author, Everett Sizemore, brings up a number of good points and ideas when it comes to SEO for an ecommerce website.

I’d like to focus on one of the points in the post; specifically, redirecting URLs with a 301 permanent redirect when a product is deleted or a filename altered. Although the examples below will entail ShopSite specific scenarios, the advice applies to almost any ecommerce software package.

Change is Inevitable

Any store owner knows that product lines change, product names mutate, and new products replace old ones. All of this is of course a good thing. What many store owners fail to realize is search engines do not like abrupt changes. Google and company like to be gently told what to do when something is not as they expect.

For ShopSite merchants, a common scenario is initially not setting a unique filename for a product’s More Information page. When omitted, ShopSite will generate a filename of the format:
product####.html
(where “####” is an internal record number)

Later on, many merchants decide they want to use a more descriptive URL/filename, so they edit the product and set the filename to something like:
fire-red-ipod.html

This is a good thing, right? It can be, but often times there are unintended consequences, especially when the old filename is not deleted:

  1. The old URL continues to be indexed
    Search engines will happily keep indexing this old, outdated page, and would be shoppers will end up here as well.
  2. Duplicate content
    Now your store has two pages with the exact same content. Get enough duplicate content, and your site may see a small penalty in terms of ranking. Worse, now the search engines have to decide which page to index, and it may be the old outdated one they decide to use.

Delete and Redirect

When you do delete a product or change its URL, make sure the old file is deleted. You can do this via FTP, or, in ShopSite, by saying “yes” to the option to also delete the file when deleting a product. In the case of changing the filename, a quick trick in ShopSite to delete the old moreinfo page is to create a test page and give it the same file name as the old product more information filename. Then delete this page in ShopSite saying “yes” to deleting the file as well.

Most importantly, make sure you set up a 301 permanent redirect. This accomplishes two tasks:

  1. Tells the search engines what to do
    A 301 redirect is an instruction to the search engines that the old URL they are trying to index has moved to a new location. This means the search engines will keep this page’s ranking the same, and update their database to display the new URL. The alternative is they delete the old page ranking and your new page will have to start all over again.
  2. Redirect potential customers correctly
    Shoppers who click on old links from other sites or search engine results will be taken to the new page seamlessly. Without a 301, they will either get the dreaded “404 not found” page or go to an old outdated page that has incorrect information.

A Few Simple Examples

Assuming your hosting platform uses the Apache web browser (almost any Unix/Linux server will fall in this category), you would put your 301 redirects in a file named .htaccess (yes, there is a dot before the word) in your main web directory (i.e. www, public_html, etc…)

The format is as follows (each redirect should be all on one line):
RedirectPermanent /old_filename.html http://xyz.com/new_filename.html

A few things to note:

  1. The first part is the old URL, starting with a slash. Do not put a full URL here, only the part after your domain name.
  2. The second part is the FULL URL to the new location. It must start with http:// to be valid
  3. The format above assumes there are no spaces in the URL.

If you do have space in the old URL/filename, enclose it in double quotes like this:
RedirectPermanent “/subdir/old file.html” http://xyz.com/new.html

Dynamic URL redirection

If the old URL you are trying to redirect is dynamic like:
http://xyz.com/cat.php?id=34

then you will need to use a mod_rewrite rule instead of a simple redirect. Here is an example:
<IFModule mod_rewrite.c>
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteCond %{QUERY_STRING} id=34
RewriteRule cat.php http://xyz.com/prod34.html? [R=301,L]
</IfModule>

* BE VERY CAREFUL when editing a .htaccess file. One minor typo can cause your entire site to break.

The Moral of the Story is:

  • Any time you make a change to a product’s URL or delete a product, set up a 301 redirect to direct search engines and potential customers to the appropriate location.

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

8 Comments

  1. Tim Sweeney says:

    Hi Rob: I came across this while working on another website. (Needed a refresher on 301 redirect under Unix) This posting was informative.

    Also, reminded me not to just deleted discontinued items for our ecommmerce site hosted with you guys.

    So whats the common practice when a product is discontinued? Where should you redirect that page to? The product that replaces it, if there is one? How about in the case there isn’t a replacement product?

    Thanks
    Tim

    • Tim,

      When a product is discontinued and it is replaced with another product, I would think you would redirect it to the new product.

      In the case of a product being discontinued and there is no replacement, I would redirect these product pages to a generic discontinued page that explains the product is no longer carried and have a category listing and search box for shoppers to find something similar.

      If the keyword for that product is a popular search term for your site, you can keep the product page intact and explain you no longer offer it, but have cross-sell items on the page that people may want to purchase that are related to the discontinued item. That way you do not lose the chance to close a sale that hits your site.

  2. Darren Moore says:

    Hi Rob,

    I arrived here due to the inevitable reason I searched for 301 info on Google. My scenrio is as follows:

    A good friend and business colleague has just had his site rebuilt, originally in html and now in .php – the designer has uploaded the site and created a load of 301’s so that he could get any inbounds pointing at the new pages.

    Problem is, he has set the 301’s to the .co.uk/index.php and not the index page, which means that now when you type in the http://www.business.co.uk it forwards to business.co.uk/index.php.

    My question is this, would it be worth while to set another 301 from the /index.php to go to the home page? I guess that we can not alter the existing redirects, so would have to set another one in place so we could get the home page indexed?

    Would appreciate your thoughts.

    Many thanks
    Darren

    • Darren,

      The index.php file is your home page, so it will be indexed. You do not need to 301 redirect an index.php page to just the domain name, as these are essentially the same thing.

      If you old homepage was index.html, just make sure this is redirected to the new index.php page. That should be all you need.

      • Darren Moore says:

        Thanks for the reply, but I think I might have got this all about face
        slightly.

        The guys who set up the redirects have placed one from the old home page –
        .co.uk to the new home page – .co.uk.index.php – which means that the new
        one is not receiving the 9500 inbounds which were pointing at the old home
        page, does that make sense?

        If there is a 301 from the home page to the .co.uk/index.php – those
        inbounds are just wasted then, am I right?

        This being the case, can a 301 be placed on the index.php to the main home
        page, will Google allow this?

        Thanks

        Darren
        PS – if you want to have a look at what I mean, the url is falcon-bikes.co.uk

        • Darren,

          I noticed that falcon-bikes.co.uk and http://www.falcon-bikes.co.uk resolve to 2 different sites (old and new I assume). You will want to fix that in case someone leaves the www. prefix off.

          Per your 301 redirect, since index.php and just your domain are the same thing, Google will see your index.php as your homepage.

          If you want, you can 301 redirect index.php to just “^$” to remove it from the URL, but Google will not mind either way.

          You can see what Google has indexed for your site by searching for “site: falcon-bikes.co.uk”

  3. Paul says:

    great post on seo and 301 re-directs. I think even now, and this was written about a year ago, we still see many ecommerce websites not doing 301 re-directs on pages that have inbound links that can help other pages increase pagerank and value.

    -Paul
    http://www.fortune3.com

Leave a Reply