What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 Stack Exchange communities.

Lately, I've seen many search results in the form of http://stackoverflow.com/q/<id> and /a/<id> on Google. Why do I see these slug-less permalinks instead of the full URL?

For instance, a search for "google search max url length" gives http://stackoverflow.com/a/41718 instead of http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers:

google search result

For the record, it seems that Google has indexed 1.7M slugless questions and 3.2M slugless answers.

share|improve this question
add comment

2 Answers

up vote 17 down vote accepted

It was a simple mistake. The code that renders the head tags was refactored to support Twitter cards, that need the open graph equivalent of <link rel="canonical"/>.

The code to set the canonical URL was there, but in the wrong rendering section, so when the link was rendered, no value was yet present and nothing got written.

I've fixed it and it's now in the right place. Of course, it will take a little time for Google to catch up.

share|improve this answer
    
I still don't see <link rel="canonical"> in the source of (M)SO. Did you already publish the fix? –  Rob W Oct 20 '13 at 14:45
    
No. that has not happened yet. –  Sklivvz Oct 20 '13 at 14:46
    
@RobW It's now on meta, I'm letting it bake for a few to make sure it's not breaking stuff. –  Sklivvz Oct 20 '13 at 14:53
    
@Sklivvz thanks for the explanation; I looked for the answer a good deal but wasn't phrasing it the right way I guess... –  Toby J Oct 23 '13 at 16:02
add comment

I noticed something that might explain this behavior.

Somewhere between September 15 this year (2013) and September 23, the dev team removed the Canonical link element that used to be on all questions pages.

How I figured this? Here is an archived version of a question from September 15 and the same question eight days later - view the source of both to see the <link rel="canonical" ...> gone.

As for why it was removed I fear only a dev can answer. Maybe a simple mistake, maybe on purpose.

share|improve this answer
    
Nice work, detective! –  Aaron Bertrand Oct 23 '13 at 15:34
    
@AaronBertrand yeah, time traveling detective! ;-) –  Shadow Wizard Oct 23 '13 at 17:56
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .