Sitemap.xml:修订间差异
小无编辑摘要 |
无编辑摘要 |
||
| (未显示同一用户的2个中间版本) | |||
| 第29行: | 第29行: | ||
|www.sitemaps.org | |www.sitemaps.org | ||
|} | |} | ||
'''Sitemap.xml'''(全称:Sitemaps Protocol,中文常译为“站点地图协议”)是一种用于告知搜索引擎网站上可供抓取的网页地址列表的开放协议标准。网站管理员可将网站中的网页 URL 制作成标准化的 Sitemap 文件,以指引搜索引擎爬虫(Crawler 或 Spider)快速、全面地抓取或更新网站内容<ref name="baidu-sitemap">[http://tousu.baidu.com/question2?prod_en=master&class=471&id=3032 百度Sitemap协议 - 百度用户服务中心]</ref><ref name="ziyuan-baidu">[https://ziyuan.baidu.com/wiki/44 Sitemap提交工具 - 百度资源平台]</ref>。该协议最初由 Google 在 2005 年 6 月推出,后于 2006 年 11 月获得微软 | '''Sitemap.xml'''(全称:Sitemaps Protocol,中文常译为“站点地图协议”)是一种用于告知搜索引擎网站上可供抓取的网页地址列表的开放协议标准。网站管理员可将网站中的网页 [[URL]] 制作成标准化的 [[Sitemap]] 文件,以指引搜索引擎爬虫(Crawler 或 Spider)快速、全面地抓取或更新网站内容<ref name="baidu-sitemap">[http://tousu.baidu.com/question2?prod_en=master&class=471&id=3032 百度Sitemap协议 - 百度用户服务中心]</ref><ref name="ziyuan-baidu">[https://ziyuan.baidu.com/wiki/44 Sitemap提交工具 - 百度资源平台]</ref>。该协议最初由 [[Google]] 在 2005 年 6 月推出,后于 2006 年 11 月获得微软([[Microsoft]])和雅虎([[Yahoo!|Yahoo]]!)的共同支持,形成了行业统一的 Sitemaps 0.9 协议标准<ref name="google-first">[https://www.w3.org/2007/06/eGov-dc/papers/Google_Sitemaps_Position_Paper.pdf Ensuring government is only one search away: Implementing the Sitemap protocol - W3C Position Paper]</ref><ref name="unified-2006">[https://news.zol.com.cn/46/463479.html Google/雅虎/微软宣布统一站点地图标准 - ZOL新闻]</ref>。Sitemap.xml 文件作为 URL 包含协议,与作为 [[URL]] 排除协议的 [[robots.txt]] 相互补充,共同帮助搜索引擎更高效地发现网站内容<ref name="seo-best-practices">[https://seo.yiguotech.com/archives/xml-sitemap-best-practices XML Sitemap 最佳实践:让搜索引擎准确发现你的每一个重要页面]</ref>。 | ||
== 历史 == | == 历史 == | ||
| 第39行: | 第39行: | ||
Sitemap 协议支持三种文件格式:XML 格式、纯文本(TXT)格式以及 Sitemap 索引(Sitemap Index)格式<ref name="ziyuan-baidu" />。XML 格式是应用最为广泛的标准格式,文件采用 UTF-8 编码,根节点为 ,并声明命名空间为 http://www.sitemaps.org/schemas/sitemap/0.9<ref name="baidu-sitemap" /><ref name="xml-structure">[https://seo.yiguotech.com/archives/xml-sitemap-best-practices XML Sitemap 最佳实践:语法与结构]</ref>。 | Sitemap 协议支持三种文件格式:XML 格式、纯文本(TXT)格式以及 Sitemap 索引(Sitemap Index)格式<ref name="ziyuan-baidu" />。XML 格式是应用最为广泛的标准格式,文件采用 UTF-8 编码,根节点为 ,并声明命名空间为 http://www.sitemaps.org/schemas/sitemap/0.9<ref name="baidu-sitemap" /><ref name="xml-structure">[https://seo.yiguotech.com/archives/xml-sitemap-best-practices XML Sitemap 最佳实践:语法与结构]</ref>。 | ||
每个 URL 条目 | 每个 URL 条目包含以下子元素: | ||
* :页面的完整 URL(含协议,必需)。 | * :页面的完整 URL(含协议,必需)。 | ||
| 第49行: | 第49行: | ||
=== 技术限制 === | === 技术限制 === | ||
根据 W3C 标准和主流搜索引擎的规范,单个 Sitemap 文件最多可包含 50,000 个 URL,未压缩体积不得超过 50 MB(或 10 MB,视搜索引擎而定)<ref name="developer-baidu">[https://developer.baidu.com/article/detail.html?id=5780853 网站地图生成技术解析 - 百度开发者中心]</ref><ref name="baidu-sitemap" />。URL 长度限制为 2,048 个字符<ref name="developer-baidu" />。对于超过限制的超大型网站,可使用 Sitemap 索引文件 | 根据 W3C 标准和主流搜索引擎的规范,单个 Sitemap 文件最多可包含 50,000 个 URL,未压缩体积不得超过 50 MB(或 10 MB,视搜索引擎而定)<ref name="developer-baidu">[https://developer.baidu.com/article/detail.html?id=5780853 网站地图生成技术解析 - 百度开发者中心]</ref><ref name="baidu-sitemap" />。URL 长度限制为 2,048 个字符<ref name="developer-baidu" />。对于超过限制的超大型网站,可使用 Sitemap 索引文件将多个 [[Sitemap]] 文件聚合提交<ref name="baidu-sitemap" />。此外,Sitemap 文件可采用 gzip 格式压缩以节省带宽<ref name="baidu-sitemap" />。 | ||
=== 纯文本格式 === | === 纯文本格式 === | ||
除 XML 格式外,网站管理员还可以提供纯文本文件作为 Sitemap,文件中每行包含一个网址。该文件同样需遵循容量限制,且必须使用 UTF-8 或 GBK 编码<ref name="baidu-sitemap" />。URL 必须是完整路径(含 http:// 或 https://),文件中不得包含网址列表以外的任何信息<ref name="baidu-sitemap" />。 | 除 XML 格式外,网站管理员还可以提供纯文本文件作为 Sitemap,文件中每行包含一个网址。该文件同样需遵循容量限制,且必须使用 UTF-8 或 GBK 编码<ref name="baidu-sitemap" />。URL 必须是完整路径(含 http:// 或 <nowiki>https://),文件中不得包含网址列表以外的任何信息</nowiki><ref name="baidu-sitemap" />。 | ||
== 与搜索引擎的交互 == | == 与搜索引擎的交互 == | ||