Re:Choosing between names and identifiers in URLs
by WorldMaker on Tuesday October 17, 2017 @04:43PM
(#15494743)
You don't necessarily have to redirect, but you should at least include `<link rel="canonical" href="..." />` (as given example StackOverflow does) so that search robots and other website (scrape and/or API) clients know which one is the canonical path, to avoid duplicate efforts.
[ Parent
| on HN ]
Re:Choosing between names and identifiers in URLs
by always_good on Tuesday October 17, 2017 @04:48PM
(#15494793)
That only works for some crawlers. Certainly not for users. Meanwhile, everything obeys redirects.
Since you bring up Stack Overflow, notice that they do the canonical redirect. Change the title in the URL and you'll get redirected.
Re:Choosing between names and identifiers in URLs
by WorldMaker on Wednesday October 18, 2017 @11:48AM
(#15500137)
Yes, the best approach is probably both, but it is crawlers that it matters more that they know the canonical paths more than users, and a crawler ignoring rel="canonical" is likely not much better than/as buggy as a crawler ignoring robots.txt; it's a specification they can ignore at their own peril.