1. 程式人生 > >如何建立sitemap索引檔案

如何建立sitemap索引檔案

我們在提交sitemap的時候如果sitemap裡面的內容太多,單個檔案如果超出了10 M或者包含網址超過了5W個

那麼我們就要建立sitemap索引檔案,下面就是一個簡單sitemap索引的例子:

 <?xml version="1.0" encoding="UTF-8"?>
   <sitemapindex>
     <sitemap>
       <loc>https://www.test.com/1.xml</loc>
       <lastmod>2018-11-28</lastmod>
     </sitemap>
     <sitemap>
       <loc>https://www.test.com/2.xml</loc>
       <lastmod>2018-11-28</lastmod>
     </sitemap>
   </sitemapindex>

具體引數說明表如下:

屬性

是否必填項

說明

<loc> </loc> Sitemap位置標籤,標示sitemap地址位置
<lastmod> </lastmod> 可填 Sitemap修改時間標籤,標示最新修改時間
<sitemap> <sitemap> </sitemap>

Sitemap資訊說明,標示某個sitemep的資訊

<sitemapindex> <sitemapindex>

標示索引檔案中所有sitemap的資訊

 

更多內容請檢視原文地址:https://www.codelovers.cn/article/20181128100507.html