Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
SEO : urls : best place for the id

My site uses URL rewriting in both formats (for different things), but I'm wondering which one is the better approach?

  1. http://www.example.com/695/title-goes-here
  2. http://www.example.com/title-goes-here/695.html
share|improve this question

marked as duplicate by John Conde Apr 7 '12 at 22:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

The file extension is one of the main things you want to remove when rewriting, because it may change in the future and you don’t want your URL to change, and because it is technical backstage stuff you don’t need to show to the user. – Simon White Feb 4 at 18:19
up vote 2 down vote accepted

Take a look at the URL of this page. It closely matches option #1.

I'm not sure if there is a limit to how long a URL search engines will index but if they do have a limit and your URL exceeds it then the ID (695 in your example) will be truncated and the page will become in accessible to them. Having the ID early in the URL will ensure they can always access the page.

share|improve this answer
agreed, but does approach #2 add any SEO benefits? (more than #1)? – siliconpi Feb 26 '11 at 15:55
@matt_tm - Have more of an SEO benefit? No. – John Conde Feb 26 '11 at 16:21
thanks again – siliconpi May 7 '11 at 10:26
@JohnConde does your answer contain an assumption that developers of SE made the best choice as opposed to merely a practical choice? – Evgeny Aug 11 '13 at 3:56

Approach #1 intuitively seems better. That's because logically, the middle of the domain is indicative of a "content hierarchy" and the last portion signifies what the actual content is.

share|improve this answer

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