Pros and Cons for having URLs for an ecommerce web site (flat vs. hierarchical tree structure), e.g.: vs.

Let’s say you have an online store with 5 categories, 3 subcategories each, and 10 products in each subcategory. How to make the URLs?

You have the following options:


There’s also a mixed option, in which the product page looks like this:


, while the categories look like this:


(in this scenario, things are mixed – the product page has no hierarchy, while the category page has one).

In each of these options, the URL can contain the full title of the product or category, or they can be abbreviated. For example, if you sell air conditioning equipment, you could have any of the following:

  • (notice the long path), or:
  • (notice the abbreviated names)

So, what to choose? Should you use subfolders (/category or /sub-category or /category/sub-category), or should you directly link to products? Also, should you use abbreviated names or long names?

Jeremy Keith - URL design,
Jeremy Keith – URL design,

First, let’s see how Matt Cutts from Google sees things:

About Matt Cutts:
„For me, the most interesting was the following statement he made:

„I wouldn’t bother with year/month/day in blog urls; I’d just use the first few words from the title of the post in the url.”

In the comments, Matt says the dates are „useless cruft to me as a user”, which could indicate he simply dislikes them from a usability standpoint.

However, my read was that he was implying that Google prefers a flat directory structure – that it’s not the date in itself that’s the problem, but rather it’s that fact that each date segment adds another directory level.”

Source: Blog Optimization and the Flat Directory Structure

So, what’s the solution?

There’s not a definite answer, but my suggestion is to have this structure:


, and also to minimize the length of the URL as much as possible. keep it as short as possible.

Below, I’ll give some pros / cons of using this structure, and argument my position.

Pros for a flat-hierarchy for URLs (use

  • Big impact – Usability, which might lead to people wanting to click more often on link and also making people link to your site. See the blog posts URL on Derek Sivers’ blog. They’re all very short & sweet. Who wouldn’t link to them? (examples:,, etc.)
  • Big impact – It’s easier to transmit a URL via phone if it’s a small one. It’s also easier to remember it and to write it down. It’s also easier to just look at the address bar in the browser and have an idea on what the page is about.
  • Small to medium impact – If you plan to change the CMS platform, it’s generally easier to migrate a flat-style architecture web site than a site with subfolders (but, on the other hand, you can still do this, and CMS changes happen rarely).
  • No impact – generally, URL length in itself is not an issue. Very long URLs are generally OK for most browsers, so this is not a worry to me.
  • No impact – I don’t agree with URL density, see Matt Cutts quote above. So, I don’t necessarily think that this URL:
    • (notice the long path and low keyword density for „air conditioning toshiba”), is better or worse for SEO purposes, than this URL:
    • (notice the abbreviated names, high keyword desnity for „air conditioning toshiba”).

Tip: don’t make it excessively short. In my opinion, Derek Sivers’ URLs are a bit excessively small. I would keep the URLs to 2-4 keywords. You should be able to understand the topic of the message from the URL, and yet have a short one in the same time.

Cons for a flat-hierarchy for URLs, and instead opting for a hierarchical tree structure (use

  • Medium impact – Depending on what business you’re in it, it might make sense to use a hierarchical structure, from an usability point of view. For example, if you sell IT, some people prefer to know if a hard-drive is an internal one, an external one, a hard drive to be used for laptops, a hybrid drive (both SSD and „classical”) and so on. You could make it very clear right from the URL.
  • Small to medium impact – Google might be able to crawl your web site better, as long as in the folder /category or in folder category/sub-category you have a listing of other URLs. So, in the /category folder you should have a listing of the subcategories, and in the /category/sub-category you should have a listing of all the products.
  • Very small impact – It might be easier for you to interpret Google Analytics statistics if you know that product X is category Y.

In my opinion, the mixed scenario I presented at the beginning:

There’s also a mixed option, in which the product page looks like this:


, while the categories look like this:


(in this scenario, things are mixed – the product page has no hierarchy, while the category page has one).

is a very poor solution, and I’d just ignore using it. To me, it’s very confusing, and it brings little to no advantages.

It’s the worst of two worlds. It’s both confusing for the users, and, in my opinion, for the engines. Avoid it.

Should you rewrite your URLs based on what I wrote here?

This question in itself requires some additional information:

  • How many links to your internal URL have (have lots of people put links to your internal pages, and now you will need to redirect those URLs)? (If you have lots of links, the impact on your site will be bigger, at least for a few months)
  • How big is the transformation? If you have very big URLs and you switch to very small URLs, you will see, probably, some good effects from usability (people will tend to link to your site more). But if you switch from already small to even smaller URLs, the impact might be small enough that it’s not worth doing.
  • Depending on your niche, a hierarchical structure might make your URLs more usable than flat-style URLs.
  • Finally, you should balance the advantages with disadvantages. You will lose some traffic/positioning in Google when you redirect from old to new URLs and the benefits might be small. There are no exact numbers, but you should weigh the arguments well prior to taking a decision.

Some good articles on the subject of URL structure:

If you plan to redirect URLs by changing the structure, you might want to read:

You might also be interested in:

Share on WhatsAppLinks giving error?

4 comentarii la „Pros and Cons for having URLs for an ecommerce web site (flat vs. hierarchical tree structure), e.g.: vs.”

  1. You are offering this urls structure:
    When we coding, how can we distinguish products and categories ? For example; I am storing product page urls in „products” table, and storing category urls in „categories” table in database. When the request come, how can I know that which table I should look ? Maybe we should use like that:

  2. Hi, Deniz,

    I would do it like this:
    1. Consider that „product-page-url” is a slug.
    2. Have all products / categories / subcategorie take one slug, different from all the previous ones.
    3. Identify the product/category/sub-category by slug.
    4. Once identified, get the type of that item (product/category/sub-category).

    Voila! :)

  3. Now what happens if you have the same product in multiple categories?
    Now you have duplicate content.

    Maybe it would be better to have your categories,

    The. Once a product is clicked it takes you to:

    Or, maybe each product hasa „default” category, so if you click on awsome-dress inside of „red-desses”, it sends you to „button-dresses” because it had been set as the „default” category.

    What’s best?

  4. I think there are some e-commerce platforms which have the issue which you describe here.

    I would consider for this just adding rel=canonical to the duplicate problem, it might be an easy fix.

    Or, don’t produce duplicate content in the first place, by avoiding to have the same product in different categories …

    Let me know if I haven’t replied with what you needed.

Lasă un comentariu

Rules for commenters »

Puteți folosi Gravatar pentru a adăuga avatar (imagine comentarii).