使用robots.txt记述sitemap.xml的位置 - 为Google, Yahoo, MSN等搜索引擎制作标准sitemap
2008-01-29 23:02Update
TAGS: robots.txt | sitemap.xml
为了方便搜索引擎能更好地抓取网站上的文件,2006年11月,Google,Yahoo,MSN等搜索引擎巨头达成了使用sitemap.xml来索引网站文件的协议。按照该协议生成的标准sitemap文件,可以被搜索引擎识别。该协议的官方网站为http://www.sitemaps.org,该网站详细规定了sitemap.xml的格式。同时建议在robots.xml里指定sitemap.xml的位置。
原文:http://www.sitemaps.org/protocol.php
--
Specifying the Sitemap location in your robots.txt file
You can specify the location of the Sitemap using a robots.txt file. To do this, simply add the following line:
Sitemap: <sitemap_location>
The <sitemap_location> should be the complete URL to the Sitemap, such as: http://www.example.com/sitemap.xml
This directive is independent of the user-agent line, so it doesn't matter where you place it in your file. If you have a Sitemap index file, you can include the location of just that file. You don't need to list each individual Sitemap listed in the index file.
------
大意是说:
在robots.xml里使用如下:
Sitemap: <sitemap_location>
指定sitemap.xml的位置。
比如,如果,你的域名为www.example.com,sitemap.xml处于该域名的根目录下,则指定为:
Sitemap: http://www.example.com/sitemap.xml
一个典型的robots.txt为:
robots.txt
User-agent: *
Sitemap: http://www.total-web.jp/sitemap.xml
Disallow: /bin/
这样,不只是Google,可以通过robots.txt通知Yahoo!,Live Search等搜索引擎sitemap.xml的所在位置了。
robots.txt官方网站:http://www.robotstxt.org/

--
Specifying the Sitemap location in your robots.txt file
You can specify the location of the Sitemap using a robots.txt file. To do this, simply add the following line:
Sitemap: <sitemap_location>
The <sitemap_location> should be the complete URL to the Sitemap, such as: http://www.example.com/sitemap.xml
This directive is independent of the user-agent line, so it doesn't matter where you place it in your file. If you have a Sitemap index file, you can include the location of just that file. You don't need to list each individual Sitemap listed in the index file.
------
大意是说:
在robots.xml里使用如下:
Sitemap: <sitemap_location>
指定sitemap.xml的位置。
比如,如果,你的域名为www.example.com,sitemap.xml处于该域名的根目录下,则指定为:
Sitemap: http://www.example.com/sitemap.xml
一个典型的robots.txt为:
robots.txt

User-agent: *
Sitemap: http://www.total-web.jp/sitemap.xml
Disallow: /bin/
这样,不只是Google,可以通过robots.txt通知Yahoo!,Live Search等搜索引擎sitemap.xml的所在位置了。
其它参考资料:
robots.txt官方网站:http://www.robotstxt.org/
- Relative Articles
- SEO优化策略 - 为图片设置alt属性和文本联结 - (2008-02-03 22:57)
- SEO优化策略 - URL越短越好吗 - (2008-02-03 22:34)