我可以在 Sitemap 的同一个 XML 中包含 <loc> 元素和 <sitemapindex> 元素吗?

Can I have <loc> element & <sitemapindex> element within the same XML for Sitemap?

<?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:video="http://www.google.com/schemas/sitemap-video/1.1">
  <url>
    <loc>http://www.example.com/foo.html</loc>
  </url>
  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <sitemap>
      <loc>http://www.example.com/sitemap1.xml.gz</loc>
      <lastmod>2004-10-01T18:23:17+00:00</lastmod>
   </sitemap>
   <sitemap>
      <loc>http://www.example.com/sitemap2.xml.gz</loc>
      <lastmod>2005-01-01</lastmod>
   </sitemap>
   </sitemapindex>
</urlset>

我可以在同一个站点地图 XML 文件中包含 urlsitemapindex 吗?我的网站上有大约 300K 多个页面。还有将近 50 个静态 HTML 页面。所以我想直接在 url 标签下添加这些静态 URL,并为动态 URL 创建一个站点地图索引。

不,那行不通。在 Search Console(以前的网站站长工具)中,您会收到一条 "Unexpected tag" 错误消息,站点地图将被删除。

最好的办法是为这 50 个 HTML 页面创建一个单独的站点地图,然后将该站点地图包含在站点地图索引文件中。