1

I have content that can be accessed from various ways. For example my content is reviews and I have three type of reviews:

/customer-reviews/11/slug.html
/third-party-reviews/11/slug.html
/products/99/reviews/11/slug.html

Another example would be products which can be viewed in ways:

/products/11/index.html
/categories/99/products/11/index.html
/suppliers/99/products/11/index.html

The thing to note is that that each set of pages is fed from single table (reviews and products respectively). Now most websites have single URL for same piece of content regardless of the "view". E.g. Christian Bale's IMDB profile is http://www.imdb.com/name/nm0000288/ whether you were looking at The Dark Knight's cast or looking for popular people born on January 30.

So for my website I plan to use URLs like these:

/reviews/11/slug.html?view=customer
/reviews/11/slug.html?view=third-party
/reviews/11/slug.html?view=products&id=99

/products/11/index.html?view=
/products/11/index.html?view=categories&id=99
/products/11/index.html?view=suppliers&id99

Depending on the view parameter, I'll show a "breadcrumb" that takes the user back to where he came from and provide some kind of visual indication of the hierarchy hierarchy.

Is this good or bad approach. And is there a better solution?

2
  • Why not use your URL segments as the discriminators? Considering we're going the way of URL rewriting largely to escape the query string approach.
    – Mr. Disappointment
    Commented Oct 12, 2011 at 11:50
  • There will be slugs within each segment and I might end up with very long urls. Commented Oct 12, 2011 at 11:53

3 Answers 3

3

Search engines, at least Google, don't care either way. If you have a clean URL structure (no duplication via URLs like /productname/colorname/ & /colorname/productname/ ) then they generally won't have a problem whether you use URL path elements or URL parameters. Both URL kinds have been around since "forever" so there's no need to worry about that.

My advice would be to primarily focus on the user and let that guide you regarding a decision like this. What works best for the user? And related, how will international (non-English) users be able to cope (if they're a part of your targeted audience)?

Things to keep in mind regardless when choosing a URL scheme:

  • Make sure you avoid duplication as much as possible
  • Use the rel=canonical where it makes sense
  • Don't try to stuff keywords into your URLs (it's not necessary)
  • Try to avoid unnecessary/unused URL elements (avoid having /123-pagename/ and /123-randomtext/ show the same content)
  • Avoid "infinite" URL nesting (/123-pagename/ links to /123-pagename/related/ links to /123-pagename/related/234-otheritem/ etc.)
1
  • Based on your suggestion, I've decided to go ahead with the shorter URL with query string. I use 301 redirects already but canonical URLs need more attention. The query string will be used only to generate the bread crumb; so I plan to point the canonical URL to the no-query string version. Commented Oct 17, 2011 at 15:19
2

I agree with Mr. Disappointment that using URL segments is the way to go. And I think you will eventually end up with shorter URL's. Query strings are more verbose. I would use URLs like this:

/reviews/11/slug/customer/
/reviews/11/slug/third-party/
/reviews/11/slug/product/99/

/products/11/
/products/11/category/99/
/products/11/supplier/99/

It's debatable if you should end your URLs with a slash or not.

2
  • The URLs you mentioned are the other way round. Reviews belong to a product (plus I also have reviews about the website and company). Likewise, products belong to a category. Sooner I'll have a hierarchy deeper than 3 levels which leads me to another problem: the url becomes too length e.g. /procucts/11/fictitious-dvd-player/reviews/12/do-not-buy.html. Commented Oct 13, 2011 at 17:54
  • I agree that reviews should be under products, but I just translated your URLs. Of course the URLs get long if you include both a slug for the product name and for the review, but isn't that what you intended? Why else do you want to include the slug? I assume it's for SEO so in that case it's suppose to include as much keywords. Commented Oct 13, 2011 at 21:36
1

I like your use of query strings, but I would also suggest to have a "default" version that effectively means no query string. When the url is processed the default query string can then be added through url rewriting to process the request. If your using an MVC framework then this can be handled for you by default routes.

You can also make use of canonical url links to mitigate this problem further.

http://www.seomoz.org/blog/canonical-url-tag-the-most-important-advancement-in-seo-practices-since-sitemaps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.