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

Simple question

What is better:

http://www.example.com/product/123/subpage/456.html

or

http://www.example.com/product?123/subpage/456

As far as I know they would rank the same SEO wise, but my SEO knowledge might be a little off. Also the last one seems to be easier and cleaner to implement on my end.

Please explain to me which is better and for what reasons.

share|improve this question

migrated from stackoverflow.com Oct 20 '10 at 9:13

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

    
This is not really programming related. –  Gumbo Oct 20 '10 at 9:12
add comment

3 Answers 3

up vote 9 down vote accepted

The first one is preferred. This is because it is interpreted as document, whereas the second one is interpreted as document up to product, and as query arguments later on. So search-engine wise, there is no difference between

http://www.example.com/product?123/subpage/456

and

http://www.example.com/product?p1=123&p3=456&p2=subpage

it is only human-eye friendly, but the search engine will not interpret it as a path. Moreover, I am sure that if a person would need to enter that in the browser manually, they will surely miss the question mark as it is not expected there (this is for path usability).

The first case (without the ?) will allow the engine to properly assign hierarhy (456 is child of subpage, which is child of 123, etc...). The second one will not.

share|improve this answer
    
Excellent answer, makes sense. +1 –  RPM1984 Oct 20 '10 at 9:09
    
How do search engines index/organize subpages? I've heard that pages deeper in a site's directory hierarchy are ranked lower than those higher up, but I've never seen any search engines do anything else special with regards to page hierarchies. –  Lèse majesté Oct 20 '10 at 12:25
1  
page hierarhies are used to build the site map automatically, that is, they are used to infer the navigation structure. Higher pages are more general than internal ones, and they suppose there is a navigation path from an external page to their children. This is used to refine searches and classify content. –  Palantir Oct 21 '10 at 13:02
add comment

I usually use http://www.example.com/product/123/subpage/456. In my case, I've been better off using this kind of URL rather than URLs with parameters. It's your decision tough...

Also, using htaccess (if you're using Apache) you can get the rewriting of the pages quite easily.

share|improve this answer
add comment

Slightly off-topic but I try anyhow:

When I encounter URLs like http://www.example.com/product/123/subpage/456.html I always think that this is an attempt on creating meaningful hierarchical URLs which, however, is not entirely hierarchical. What I mean is, you should be able to slice off one level at a time. In the above, the URL has two violations on this principle:

  1. /product/123 is one piece of information represented as two levels. It would be more correctly represented as /product:123 (or whatever delimiter you like)
  2. /subpage is very likely not an entity in itself (i.e., you cannot go up one level from 456.html as http://www.example.com/product/123/subpage is "nothing").

Therefore, I find the following more correct:

http://www.example.com/product:123/456.html

Here, you can always navigate up one level at a time:

  • http://www.example.com/product:123/456.html — The subpage
  • http://www.example.com/product:123 — The product page
  • http://www.example.com/ — The root

Following the same philosophy, the following would make sense:

http://www.example.com/products/123/456.html

Where:

  • http://www.example.com/products/123/456.html — The subpage
  • http://www.example.com/products/123 — The product page
  • http://www.example.com/products — The list of products
  • http://www.example.com/ — The root

(Sorry about spamming your question, @red-X)

share|improve this answer
add comment

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.