sitemapindex站点地图索引文件用法

昨晚有朋友发来问我关于上篇文章(大型网站Sitemap生成方法)关于如何将child-sitemap写入到main-sitemap中,这里主要是用到的站点地图协议sitemapindex!

sitemapindex主要包括以下几个标记!

  • <> – 文件中列出的每个站点地图的父标记(<sitemapindex> 的子标记)
  • <loc> – 站点地图的位置(<sitemap> 的子标记)
  • <lastmod> – 站点地图 的上次修改日期(可选)

示例如下:

1
2
3
4
5
6
7
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <sitemap>
      <loc>http://www.example.com/sitemap1.xml.gz</loc>
      <lastmod>2010-12-01T18:28:17+00:00</lastmod>
   </sitemap>
</sitemapindex>

并且我发现了一个很有意思的现象,网易的网站地图居然连sitemap协议都不遵守,不知网易的开发人员是咋搞的!网易sitemap地址:http://news.163.com/sitemap.,趁网易人员没看到此文章赶紧上图来看看:

从图中我们可以看到,网易开发人员居然直接将sitemap写成了urlset的子标签!将urlset 与sitemapindex子标签内容混合编写,这就相当于将向柴油机里加水,无论加多少也跑不起来啊!杯具!这种写法明显不符合协议规则!

9 Responses to “sitemapindex站点地图索引文件用法”

  1. 汗,学的都换给老师了

    [Reply]

  2. CHINA Internet Explorer Windows says:

    站点地图,是不是需要工具 才能 做的

    [Reply]

  3. 有些都是自动生成的。

    [Reply]

  4. 爱归零 CHINA Google Chrome Linux says:

    真是不懂……
    PS:读者中有网易的没,赶快来围观。哈哈

    [Reply]

    久酷 AUSTRALIA Google Chrome Windows Reply:

    @爱归零, 估计有网易的也不是负责这块的,哈哈

    [Reply]

    爱归零 CHINA Google Chrome Linux Reply:

    @久酷, 呵呵,即使有也没关系哈

    [Reply]

  5. 帅哥 CHINA Google Chrome Windows says:

    沙发…
    可惜不懂…

    [Reply]

    久酷 AUSTRALIA Mozilla Firefox Windows Reply:

    @帅哥, 用到时就懂啦

    [Reply]

    帅哥 UNITED STATES Google Chrome Windows Reply:

    @久酷, XML没学过,只是看了几页就把书还到图书馆了

    [Reply]

Leave a Reply

:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!:


正在读取数据……