前军教程网

中小站长与DIV+CSS网页布局开发技术人员的首选CSS学习平台

sitemap 网站地图是什么格式?有什么好处?

sitemap 网站地图方便搜索引擎发现和爬取网页

站点地图是一种 xml 文件,或者是txt,是将网站的所有网址列在这个文件中,为了方便搜索引擎发现并收录的。

sitemap 网站地图分两种:用于用户导航和搜索引擎收录。对于搜索引擎收录,可使用 xml、txt、html格式。

xml 版本的格式如下

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>https://search.fuyeor.com/zh-cn/</loc>
<priority>0.9</priority>
<lastmod>2022-03-17</lastmod>
<changefreq>monthly</changefreq>
</url>
<url>
<loc>https://search.fuyeor.com/nav/mobile/index.html</loc>
<priority>0.9</priority>
<lastmod>2022-03-17</lastmod>
<changefreq>monthly</changefreq>
</url>
<url>
<loc>https://search.fuyeor.com/nav/one/index.html</loc>
<priority>0.9</priority>
<lastmod>2022-03-17</lastmod>
<changefreq>monthly</changefreq>
</url>
<url>
<loc>https://search.fuyeor.com/nav/easy/index.html</loc>
<priority>0.9</priority>
<lastmod>2022-03-17</lastmod>
<changefreq>monthly</changefreq>
</url>
<url>
<loc>https://search.fuyeor.com/nav/simple/index.html</loc>
<priority>0.9</priority>
<lastmod>2022-03-17</lastmod>
<changefreq>monthly</changefreq>
</url>
</urlset>

也可以使用 txt 格式的 sitemap:

还可以使用 html 格式的站点地图:

这种可以做成方便用户导航的站点地图。示例:

<ul>
<a href="https://video.fuyeor.com/watch/FXziOoU7PSM8Dau">https://video.fuyeor.com/watch/FXziOoU7PSM8Dau</a>
<a href="https://video.fuyeor.com/watch/757cSn4KS3JdGC8">https://video.fuyeor.com/watch/757cSn4KS3JdGC8</a>
<a href="https://video.fuyeor.com/watch/xDzz4CCqDwGqyAl">https://video.fuyeor.com/watch/xDzz4CCqDwGqyAl</a>
</ul>

上面的这种站点地图真的很重要,方便用户站内导航。很多网站都有这样的站点地图:

苹果站点地图:

参考

  1. ^xml 格式的站点地图例如这个: https://search.fuyeor.com/sitemap.xml
  2. ^txt 版本是站点地图,就是将 url 写入一个 txt 格式的文件。相比于 xml 版本功能有所欠缺。例如: https://www.fuyeor.com/index/sitemaps.txt

发表评论:

控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言