使用 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/