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

Stack Overflow sites all have pretty urls which include the question title. In the HTML it also have canonical url for that page.

I just found out that when I change the question title, the url is changed immediately. The canonical url is also updated. Does it mean that as long as the page with the old canonical url redirects to the new canonical url, then search engines will update their records of the canonical url as well?

Is there anything else that one can actively do to make the url change even more smoother?

share|improve this question
add comment

1 Answer

up vote 15 down vote accepted

All questions on Stack Exchange contain a numeric ID (28070 for this question) which is the only thing that uniquely identifies a question.

So when a question title is changed, the URL such as /28070/old-question-title still shows the question because the ID is still there. The ID is looked up and the new title returned, meaning that the new URL can be determined and shown in the canonical tag.

This works perfectly well for search engines - when they see the old URL they can see the canonical URL (or get a 301 redirect in most cases), so update their index.

share|improve this answer
2  
This reminds me of a classic database design argument over whether primary keys should be meaningful or meaningless. On the one hand, many classes of objects seem to have unique inherent attributes that on the surface of it are perfectly suited to use as a primary key. This saves DB designers from creating a dedicated primary key serving no other purpose. However, in reality, many of these "obvious" primary keys are mutable. A person's name can change (e.g. they get married), as can their address, phone number, etc. Even something like an employee ID can change if the ID format is altered. –  Lèse majesté Apr 2 '12 at 13:09
    
This shows once more that Google's SEO is pushing the world. I struggle to find a reason sites need long urls full of SEO keywords when a shorter url with just the number would suffice. And don't tell me it increase user experience because the user still needs to enter the number in the url/link to get to the page, so there is no excuse for the keywords in url other than SEO. –  Marco Demaio Apr 2 '12 at 16:49
    
@Marco the UX argument is not about the user typing in the URL, it is about giving the user an indication of what the page is about. There is a valid argument for not using an ID at all, but then you hit technical difficulties looking up long strings instead of a quick simple ID. –  DisgruntledGoat Apr 2 '12 at 19:07
1  
@Lese I think you just answered your own debate ;) Meaningless primary keys don't really have any disadvantages and you can still use additional unique constraints in your database. –  DisgruntledGoat Apr 2 '12 at 19:11
1  
@lulala: Yes, if you either 301 or set the canonical link, Google will know to update their index. –  Lèse majesté Apr 3 '12 at 9:26
show 1 more 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.