tbtc-website
tbtc-website copied to clipboard
Localized canonical URLs
Originally posted by @mhluongo in https://github.com/keep-network/tbtc-website/pull/163#issuecomment-650466475
@ironng thoughts on localized page paths that the English URL 301s to, with the canonical URL rel set to the localized path? I think it would be a big SEO win and might be a better experience, but haven't thought about implementation
I'm not sure what you're trying to describe here. Can you elaborate a bit more?
Here's a bit more context
This doesn't handle redirecting the news article or resource article pages to the correct translation from the language selector. Right now, it tries to just reload the same page to the equivalent locale's page, but this doesn't work for the article pages: For example: Going from /de/news to /news works However /de/news/2020-04-25-tbtc-launch-eckdaten to /news/2020-04-25-tbtc-launch-eckdaten doesn't, since that article doesn't exist at that url.
We've taken a "forked content" approach to localization- eg some content isn't ever going to exist between locales- so I think your approach makes sense. In an ideal world perhaps the 404 would point people to the localized index? A straight redirect seems like an abuse of HTTP :)
We've forked our content, including paths- so there's not a great way to link an "original" vs translated material. One approach would be to include metadata per post that includes the original material's path, and then serves it via that path- eg /news/de/2020-07-23-tbtc-safety
which served, either directly with a canonical URL, or via a 301, /news/de/2020-07-23-tbtc-sicherheit
The EN path and the localized path could both be visible to search engines, and it would resolve our "show me the DE version of this article" issue, which currently leads to a poor 404 experience