Legacy Knowledge Base
公開されました Jul. 2, 2025

サイトマップ インデックス: 値が "x-default" の hreflang 属性

Written By

Phil Chapman

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

問題

当社の 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 フラグの代替が含まれています。

追加情報

Did this article resolve your issue ?

Legacy Knowledge Base