網(wǎng)站地圖是一個網(wǎng)站的縮影,包含網(wǎng)站的內(nèi)容地址,是根據(jù)網(wǎng)站的結(jié)構(gòu)、框架、內(nèi)容,生成的導(dǎo)航文件。網(wǎng)站地圖分為三種文件格式:xml格式、html格式以及txt格式。xml格式和txt格式一般用于搜索引擎,為搜索引擎蜘蛛程序提供便利的入口到你的網(wǎng)站所有網(wǎng)頁;html格式網(wǎng)站地圖可以作為一個網(wǎng)頁展示給訪客,方便用戶查看網(wǎng)站內(nèi)容。本文主要講解xml格式的網(wǎng)站地圖相關(guān)內(nèi)容和生成方法。
Sitemap 0.90 是依據(jù)創(chuàng)意公用授權(quán)-相同方式共享的條款提供的,并被廣泛采用,受 Google、Yahoo! 和 Microsoft 在內(nèi)的眾多廠商的支持。網(wǎng)址:https://www.sitemaps.org/zh_CN/faq.html。
2 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
5 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
6 <url>
7 <loc>http://www.xiaowangyun.com/</loc>
8 <changefreq>daily</changefreq>
9 </url>
10 <url>
11 <loc>http://www.xiaowangyun.com/wyblog?catid=43</loc>
12 <changefreq>daily</changefreq>
13 </url>
14 <url>
15 <loc>http://www.xiaowangyun.com/wyblog/?catid=167</loc>
16 <changefreq>daily</changefreq>
17 </url>
18 <url>
19 <loc>http://www.xiaowangyun.com/wyblog/?catid=170</loc>
20 <changefreq>daily</changefreq>
21 </url>
22 </urlset></pre>
網(wǎng)站地圖制作提交步驟:
1、生成網(wǎng)站地圖:
網(wǎng)頁版:http://www.xml-sitemaps.com/
2、下載生成的地圖文件sitemap.xml并上傳至網(wǎng)站根目錄
3、到站長平臺提交網(wǎng)站地圖。
生成網(wǎng)站地圖:http://www.xml-sitemaps.com/
change frequency:指的是頻率,地圖的自動更新頻率,默認(rèn)每天(daily);
last modification:是網(wǎng)站地圖最后修改時間,默認(rèn)使用服務(wù)器的響應(yīng)(Use server's response);
priority:權(quán)重-可自動計算。
點擊start開始生產(chǎn)。自動跳轉(zhuǎn)到生成頁面,稍等一段時間便可生成(時間和網(wǎng)站內(nèi)容多少有關(guān))。
它提供多種格式的網(wǎng)站地圖文件下載(xml、xml.gz、ror.xml、html等),看你所提交的搜索引擎需要哪種格式的地圖文件,就下載哪一個,或者直接打包全下載。
各搜索引擎推薦網(wǎng)站地圖格式:
Google:建議使用xml格式的網(wǎng)站地圖
地圖提交地址:https://www.google.com/webmasters/tools/dashboard?hl=zh-CN
Yahoo: 建議使用Txt格式的網(wǎng)站地圖
Yahoo地圖提交地址 :http://sitemap.cn.yahoo.com/?require_login=1
Baidu:建議使用robots.txt提交html格式的網(wǎng)站地圖
http://www.baidu.com/search/url_submit.html
在robots.txt爬蟲協(xié)議中定義(Allow: /sitemap.hxml)robots.txt文檔是表式允許蜘蛛網(wǎng)訪問網(wǎng)站地圖。