我最近对我的站点地图做了一些修改,因为我更新了我的网站以支持两种语言,但是现在我在提交站点地图时遇到了一个错误,我不知道问题出在哪里。
Sitemap或Sitemap索引文件没有正确声明命名空间。
> Examples
> Line 5
> Parent tag:
> url
> Tag:
> link
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/TR/xhtml11/xhtml11_schema.html" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.w3.org/TR/xhtml11/xhtml11_schema.html http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd">
<url>
<loc>https://example.com/</loc>
<xhtml:link rel="canonical" href="https://example.com/"/>
<xhtml:link rel="alternate" hreflang="el" href="https://example.com/"/>
<xhtml:link rel="alternate" hreflang="el-GR" href="https://example.com/"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/"/>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en"/>
<lastmod>2020-02-25T12:41:35+00:00</lastmod>
<priority>1.00</priority>
</url>
````````
</urlset>*最新情况
尝试了这个方法,就像谷歌文档说的那样
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">虽然在使用xmlns:xhtml="http://www.w3.org/1999/xhtml"将xml转换为纯文本时,将http更改为https正确地输出了xml并完成了工作--但我已经看到您必须只使用http来避免我的问题,老实说,这太让人困惑了。
发布于 2021-06-23 21:13:02
最后使用xmlns:xhtml="http://www.w3.org/1999/xhtml"似乎是Google的问题,它没有正确地呈现XHTML (如果我理解正确的话),sitemap现在运行良好,尽管它没有正确地呈现。
您可以阅读更多关于它的这里。
https://webmasters.stackexchange.com/questions/135851
复制相似问题