seo - 使用 sitemap.txt 创建 sitemapindex 文件

标签 seo sitemap plaintext

使用 XML 站点地图,我们可以创建一个 sitemap.xml 文件:

<sitemapindex>
 <sitemap>
  <loc>https://www.example.com/0.xml</loc>
 </sitemap>
 <sitemap>
  <loc>https://www.example.com/1.xml</loc>
 </sitemap>
</sitemapindex>

但是我们如何使用 sitemap.txt 文件实现相同的效果呢?我们是否将其包含在 robots.txt 中?

最佳答案

站点地图协议(protocol)不支持文本格式的站点地图索引文件。

您必须提供多个站点地图文件( Other Sitemap formats → 文本文件):

Each text file can contain a maximum of 50,000 URLs and must be no larger than 50MB (52,428,800 bytes). If you site includes more than 50,000 URLs, you can separate the list into multiple text files and add each one separately.

然后指定 informing search engines about your sitemap 时的所有文件,例如,在您的 robots.txt 中:

Sitemap: https://example.com/sitemap_1.txt

Sitemap: https://example.com/sitemap_2.txt

Sitemap: https://example.com/sitemap_3.txt

关于seo - 使用 sitemap.txt 创建 sitemapindex 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48855466/

相关文章:

html - anchor /跳转链接的规范 URL?

seo - 谷歌站点地图

.net - 动态更改 SiteMapNode 的标题

jquery - 如何阻止 jQuery 从 .html() .val() .text() 等格式化代码返回制表符和空格

PHP cURL 获取明文

mysql - 如何将存储在注册表中的Mysql odbc连接字符串整理为纯文本

html - SEO META 标签 - HTML

optimization - SEO 优化错误,抓取不当或索引不当

javascript - Ajax 历史对 SEO 不利

xml - 在 Liferay 中包含静态站点地图