views:

124

answers:

4

This question may seem a little bit stackoverflow-implementation specific, but I have seen a similar pattern on other websites that are using REST-friendly URL rewriting as well.

For example, a link to a particular question looks like this: http://stackoverflow.com/questions/1388703/asp-net-mvc-passing-redundant-arguments-to-actions

1388703 apparently being some kind of unique ID and the rest being the Title of the question.

The ID itself should be enough, so what may be the advantage of putting the question title (in this particular case, one can see that stackoverflow uses this almost everywhere, e.g. for badges, user profiles etc.) as second parameter?

When you remove the last part of the URL, the same page is displayed, which is expected. But when you change the last part to any other string, the same result is still displayed.

Is this only a cosmetic issue, allowing easier management of links (e.g. when storing bookmarks?) or does it have any other advantages?

A: 

It is cosmetic and it's also better search engine optimization to keep easily readable names in the url as that will make the search engines find it easier.

Robban
A: 

The biggest advantage that the extra text has is for SEO. The extra text in the link gives google a lot more help understanding what's in the page.

ilivewithian
+4  A: 

It's for search engine optimization.

The link http://stackoverflow.com/questions/1388703 doesn't mean much to a search engine but http://stackoverflow.com/questions/1388703/asp-net-mvc-passing-redundant-arguments-to-actions allows a search engine to match the words "asp net mvc" etc which they will normally give more weight to as it's in the URL.

It's also more user friendly as it gives more meaning to the content of the page form the URL.

David G
A: 

I'd also mention that if a title is changed (i.e. for spelling, etc), the ID number still works.

mgroves