I have a question about using link[rel="alternate"][hreflang]
elements.
Consider a company with an international site com-domain
and a site located inside China cn-domain
(actual domains trigger Stack Overflow spam filters). Both sites have identical content, available in English, French, and Chinese.
I believe that the way link[rel="alternate"][hreflang]
elements are currently being specified on both sites is incorrect.
The only difference between the two is the default language, where there is no language code in the URL path. On com-domain
it is English, and on cn-domain
it is Chinese.
Consider the following six URLs:
com-domain/path/to/product
(English default)com-domain/fr/path/to/product
(French)com-domain/zh/path/to/product
(Chinese)cn-domain/path/to/product
(Chinese default)cn-domain/en/path/to/product
(English)cn-domain/fr/path/to/product
(French)
I believe that when specifying link[rel="alternate"][hreflang]
elements all six addresses should be included on all six pages, like so (proto
instead of https
because of spam filters):
<link rel="alternate" href="proto://com-domain/path/to/product" hreflang="en">
<link rel="alternate" href="proto://cn-domain/en/path/to/product" hreflang="en">
<link rel="alternate" href="proto://com-domain/fr/path/to/product" hreflang="fr">
<link rel="alternate" href="proto://cn-domain/fr/path/to/product" hreflang="fr">
<link rel="alternate" href="proto://com-domain/zh/path/to/product" hreflang="zh">
<link rel="alternate" href="proto://cn-domain/path/to/product" hreflang="zh">
and NOT what we are currently doing, which is only showing the pages from the same domain like so:
on com-domain
:
<link rel="alternate" href="proto://com-domain/path/to/product" hreflang="en">
<link rel="alternate" href="proto://com-domain/fr/path/to/product" hreflang="fr">
<link rel="alternate" href="proto://com-domain/zh/path/to/product" hreflang="zh">
on cn-domain
:
<link rel="alternate" href="proto://cn-domain/en/path/to/product" hreflang="en">
<link rel="alternate" href="proto://cn-domain/fr/path/to/product" hreflang="fr">
<link rel="alternate" href="proto://cn-domain/path/to/product" hreflang="zh">
Could someone clarify which is correct?