問題
当社の DXP サイトでは、英語 (英国) がデフォルトの言語になっています。 Liferay サイトマップの場合、この例のように hreflang 属性に関連付けられた「en-GB」値が表示されることを期待すべきではありませんか?
<url>
<loc>http://localhost:8080/page1</loc>
<lastmod>2021-09-26T06:6:30+00:00</lastmod>
<changefreq>daily</changefreq>
<xhtml:link href="http://localhost:8080/zh/page1" hreflang="zh-CN" rel="alternate"/>
<xhtml:link href="http://localhost:8080/page1" hreflang="en-GB" rel="alternate"/>
<xhtml:link href="http://localhost:8080/in/page1" hreflang="in-ID" rel="alternate"/>
<xhtml:link href="http://localhost:8080/vi/page1" hreflang="vi-VN" rel="alternate"/>
<xhtml:link rel="alternate" hreflang="en-GB" href="http://localhost:8080/page1"/>
</url>
Environment
- DXP 7.3
解決策
-
ここでは、次のように構成 hreflang="x-default" が想定されています。
<url>
<loc>http://localhost:8080/page1</loc>
<lastmod>2021-09-26T06:6:30+00:00</lastmod>
<changefreq>daily</changefreq>
<xhtml:link href="http://localhost:8080/zh/page1" hreflang="zh-CN" rel="alternate"/>
<xhtml:link href="http://localhost:8080/page1" hreflang="en-GB" rel="alternate"/>
<xhtml:link href="http://localhost:8080/in/page1" hreflang="in-ID" rel="alternate"/>
<xhtml:link href="http://localhost:8080/vi/page1" hreflang="vi-VN" rel="alternate"/>
<xhtml:link rel="alternate" hreflang="x-default" href="http://localhost:8080/page1"/>
</url>
- 「x-default」は、検索エンジン用の特別な言語キーです。 さらに、サイトマップには代替 URL の下に en-GB フラグの代替が含まれています。
追加情報
- Google ドキュメンテーション: 国際ランディング ページ用の「x-default hreflang」の導入
- Google ビデオ: サイトをより多くの言語に拡張する