神馬搜索移動(dòng)適配指南
1. 基本功能
供站長(zhǎng)提交pc->wap對(duì)應(yīng)關(guān)系,神馬搜索根據(jù)對(duì)應(yīng)關(guān)系將收錄的PC頁替換為wap頁
2. 適用范圍
網(wǎng)站兼有PC版和Wap版
3. 移動(dòng)適配方式
A. 自主適配
B. 標(biāo)注Meta聲明
C. 提交頁面對(duì)應(yīng)關(guān)系
3.1 自主適配
1)含義:站長(zhǎng)自己做好PC和wap網(wǎng)頁的自適配,當(dāng)用戶在移動(dòng)設(shè)備訪問PC網(wǎng)頁時(shí)自動(dòng)適配到wap網(wǎng)頁。
2)舉例:用戶在手機(jī)端訪問http://www.taobao.com/,站點(diǎn)自適配到http://m.taobao.com/。
3)適用網(wǎng)站:網(wǎng)站有能力做好pc和wap頁面自適配
4)建議:自主適配是最理想的移動(dòng)適配方案,用戶在移動(dòng)設(shè)備無論是通過神馬搜索還是通過其它瀏覽渠道都會(huì)展現(xiàn)wap頁,建議使用此方案!
3.2標(biāo)注Meta聲明
1)含義:站長(zhǎng)做PC和wap網(wǎng)頁自適配有困難,可以在PC網(wǎng)頁源碼的Meta字段添加PC和wap的頁面對(duì)應(yīng)關(guān)系,神馬根據(jù)用戶終端給出適合展示的頁面。
2)Meta聲明格式:<meta name="mobile-agent" content="format=[wml|xhtml|html5]; url=url">,紅色部分由站點(diǎn)填充具體內(nèi)容。
3)Meta聲明舉例:<meta name ="mobile-agent" content="format=xhtml; url=http://sina.cn/">
3.3提交頁面對(duì)應(yīng)關(guān)系
1)適用網(wǎng)站:針對(duì)未做自適配和PC頁meta標(biāo)注聲明的網(wǎng)站。同時(shí),為神馬搜索能夠更準(zhǔn)確快速地處理移動(dòng)適配,建議做了自適配和meta標(biāo)注聲明的網(wǎng)站同時(shí)提交頁面對(duì)應(yīng)關(guān)系。
2)對(duì)應(yīng)關(guān)系類型:url級(jí)對(duì)應(yīng)及url pattern級(jí)對(duì)應(yīng)關(guān)系(也可兩者兼有),具體提交文件格式及pattern寫法見附錄.
3)提交文件格式:xml或txt,建議xml
4)建議:直接提交對(duì)應(yīng)關(guān)系sitemap,后續(xù)需要持續(xù)的更新和維護(hù),成本較大,不推薦使用。
3.4三種移動(dòng)適配方案的異同
適配方案網(wǎng)站提供適用網(wǎng)站
自助適配
1.網(wǎng)站自行做好自適配
2.向神馬搜索提供頁面對(duì)應(yīng)關(guān)系(非必須)
有技術(shù)能力做好PC版和Wap版網(wǎng)頁的自適配的網(wǎng)站
Meta聲明
1.網(wǎng)站自行做好PC版網(wǎng)頁的Meta標(biāo)注聲明
2.向神馬搜索提供頁面對(duì)應(yīng)關(guān)系(非必須)
有PC和Wap版網(wǎng)頁,能推動(dòng)PC版網(wǎng)頁加Meta標(biāo)注說明的網(wǎng)站
提交對(duì)應(yīng)關(guān)系直接在站長(zhǎng)工具提交PC和Wap網(wǎng)頁對(duì)應(yīng)關(guān)系無法實(shí)現(xiàn)自適配和推動(dòng)PC版網(wǎng)頁加Meta標(biāo)注
附錄1:PC和Wap url pattern制作過程
步驟1:確定PC url中的可替換參數(shù)或路徑,得到其位置序號(hào)和類型
PC url:http://www.domain.com/2014/0514/Y5SYZ90.html
從網(wǎng)站url結(jié)構(gòu)來分析,其中2014,0514和Y5SYZ90為動(dòng)態(tài)可替換的路徑。除Y5SYZ90為字母和數(shù)字混合外,其余均為純數(shù)字。
步驟2:根據(jù)可替換參數(shù)或路徑得到pc網(wǎng)頁pattern。
PC url pattern:http://www.domain.com/(\d+)/(\d+)/(\w+).html
(\d+)表示純數(shù)字字符串,(\w+)表示數(shù)字或字母組成的字符串。
步驟3:比對(duì)PC和移動(dòng)url的結(jié)構(gòu),根據(jù)可替換參數(shù)在步驟1中的位置序號(hào),依次用${1},${2},……表示替換掉移動(dòng)url 中的可替換參數(shù)或路徑,得到移動(dòng)url pattern。
移動(dòng)url pattern:http://m.domain.com/${1}/${2}/${3}.html
附錄2:移動(dòng)適配對(duì)應(yīng)關(guān)系文件格式
1)url級(jí)別對(duì)應(yīng)xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset>
<url>
<!—必填項(xiàng),表示PC網(wǎng)頁的url地址 -->
<loc>http://www.domain.com/abc.html</loc>
<data>
<display>
<!—可選項(xiàng),表示PC網(wǎng)頁對(duì)應(yīng)的html5版手機(jī)頁url地址 -->
<html5_url>http://h5.domain.com/abc.html</html5_url>
<!—可選項(xiàng), 表示PC網(wǎng)頁對(duì)應(yīng)的wml版手機(jī)頁url地址-->
<wml_url>http://wml.domain.com/abc.html</wml_url>
<!—可選項(xiàng), 表示PC網(wǎng)頁對(duì)應(yīng)的xhtml版手機(jī)頁url地址-->
<xhtml_url>http://xhmtl.domain.com/abc.html</xhtml_url>
</display>
</data>
</url>
<!-- 下一組url 放在一個(gè)新的url 節(jié)點(diǎn)內(nèi) -->
</urlset>
2)url pattern級(jí)別對(duì)應(yīng)xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset>
<!-- 表示www.domain.com 下的一組pattern 或url對(duì)應(yīng)關(guān)系 -->
<url>
<loc>http://www.domain.com/</loc>
<!-- 表示pc站點(diǎn)的網(wǎng)址首頁 -->
<data>
<display>
<pc_url_pattern>
http://www.domain.com/(\d+)/(\d+)/(\w+).html
</ pc_url_pattern>
<!-- 表示該P(yáng)C頁的url pattern-->
<xhtml_url_pattern >
http://m.domain.com/news/${1}/${2}/${3}.html
</xhtml_url_pattern>
<!-- 一組PC pattern 可能含有多個(gè)版式的手機(jī)頁pattern -->
</display>
</data>
</url>
<!-- 下一組pattern 放在一個(gè)新的url 節(jié)點(diǎn)內(nèi) -->
</urlset>
3)url級(jí)別對(duì)應(yīng)txt
每行兩列數(shù)據(jù),第一列為PC url,第二列為對(duì)應(yīng)Wap url,兩列數(shù)據(jù)以tab鍵做分隔。
示例:
http://www.domain.com/abc.html http://h5.domain.com/abc.html
http://www.domain.com/def.html http://h5.domain.com/def.html
4)url pattern級(jí)別對(duì)應(yīng)txt
每行兩列數(shù)據(jù),第一列為PC url pattern,第二列為對(duì)應(yīng)Wap url pattern,兩列數(shù)據(jù)以tab鍵做分隔。
示例:
http://www.domain.com/(\d+)/(\d+)/(\w+).html http://m.domain.com/news/${1}/${2}/${3}.html
http://www.domain.com/(\d+)/(\w+).html http://m.domain.com/news/${1}/${2}.html
來源:神馬站長(zhǎng)平臺(tái)