【发布时间】:2019-12-27 13:33:52
【问题描述】:
我已经尝试了几乎所有我能想到的东西,并在这里搜索过,但无济于事。为什么此提要在 Google 网站管理员工具中似乎不起作用:
https://www.campgroundreviews.com/sitemap
它的截断版本是:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.campgroundreviews.com/sitemap/users/1</loc>
</sitemap>
<sitemap>
<loc>https://www.campgroundreviews.com/sitemap/users/2</loc>
</sitemap>
</sitemapindex>
以及单个站点地图的截断版本 (https://www.campgroundreviews.com/sitemap/cities/13):
<?xml version="1.0" encoding="UTF-8"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>http://www.campgroundreviews.com/regions/california/twentynine-palms-marine-corps-ctr</loc>
<priority>0.8</priority>
<lastmod>2019-11-27T23:31:14+00:00</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>http://www.campgroundreviews.com/regions/california/travis-afb</loc>
<priority>0.8</priority>
<lastmod>2019-10-24T02:00:58+00:00</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>http://www.campgroundreviews.com/regions/california/yuba</loc>
<priority>0.8</priority>
<lastmod>2019-03-12T11:00:38+00:00</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
标头中的内容类型返回为text/xml; charset=UTF-8。
在 Google 网站管理员工具中,我得到:
从未发现任何 URL。它总是说 Sitemap is HTML,但对于我的生活,我不知道为什么。
有什么想法吗?
【问题讨论】:
-
除了您的有效性错误,我向您展示了如何修复并且只收到您的反对票,您必须确保您的站点地图不是作为 HTML 提供的。查看重复的链接。
-
我已经检查了所有这些链接。如果您查看我发布的链接,它们不是作为 HTML 提供的。你投了反对票,因为你回答了一个我从未问过的问题。
-
这不是重复的帖子。请阅读!
-
很抱歉这些链接和验证修复没有帮助。无论如何,您都应该保留验证修复程序,因为在您解决“站点地图是 HTML”错误后它们会很有用。我将重新打开您的问题...
-
当您在等待一个明确的答案时,您可以尝试删除 XSLT 处理指令:
<?xml-stylesheet type="text/xsl" href="/sitemap.xsl"?>这应该没问题,但有时修剪到 minimal reproducible example 可能会让人感到意外。在这种情况下,如果 Google 的代理在解析 XML 之前运行 XSLT,那么 XSLT 转换的结果将是 HTML,这可能会导致您的“站点地图是 HTML”。
标签: google-search-console xml-sitemap