Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Oct 12 '11 at 18:03

This question came from our site for professional and enthusiast programmers.

    
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 Oct 12 '11 at 11:50
    
There will be slugs within each segment and I might end up with very long urls. –  Salman A Oct 12 '11 at 11:53

3 Answers 3

up vote 2 down vote accepted

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.)
share|improve this answer
    
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. –  Salman A Oct 17 '11 at 15:19

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.

share|improve this answer
    
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. –  Salman A Oct 13 '11 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. –  Marco Miltenburg Oct 13 '11 at 21:36

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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