移動適配
當您的網(wǎng)站有PC和移動版本,希望神馬收錄移動版本時,我們建議:
1. 網(wǎng)站自己做好PC和移動網(wǎng)頁的自適配,當用戶在移動設(shè)備訪問PC網(wǎng)頁時自動適配到移動網(wǎng)頁。
2. 網(wǎng)站做PC和移動網(wǎng)頁自適配有困難,可采用在PC版網(wǎng)頁標注meta聲明的方式。
具體的操作步驟:
1) 在PC網(wǎng)頁源碼的Meta字段添加PC和移動頁面對應(yīng)關(guān)系聲明
Meta聲明格式為: <meta name="mobile-agent" content="format=[wml|xhtml|html5]; url=對應(yīng)的移動網(wǎng)頁網(wǎng)址"/>
2) 在神馬站長工具提交PC和移動網(wǎng)頁對應(yīng)關(guān)系。此為非必要步驟,但聲明后提交對應(yīng)關(guān)系能幫助神馬盡快完成PC和移動頁面的轉(zhuǎn)換。
3. 未做自適配和Meta標注聲明,可直接在神馬站長工具提交頁面對應(yīng)關(guān)系。PC和移動頁面對應(yīng)關(guān)系可以是pattern級別和url級別,也可兩者兼有。
PC url pattern與移動url pattern對應(yīng)關(guān)系
PC url pattern:表示PC版網(wǎng)頁pattern,在PC頁url基礎(chǔ)上,首先確定url中哪些路徑或參數(shù)是可替換的。然后根據(jù)其類型,使用正則匹配符號(\d+)或者(\w+)表示該路徑或參數(shù)。(\d+)表示純數(shù)字字符串,(\w+)表示數(shù)字或字母組成的字符串。
移動url pattern:可以是xhtml/html5/wml版式的手機頁pattern。在移動url的基礎(chǔ)上,根據(jù)可替換參數(shù)在對應(yīng)的PC頁pattern中出現(xiàn)的順序,依次用${1},${2},……表示該參數(shù)。
示例
1. 確定PC url中的可替換參數(shù)或路徑,得到其位置序號和類型
PC url:http://www.domain.com/2014/0514/Y5SYZ90.html
從網(wǎng)站url結(jié)構(gòu)來分析,其中2014,0514和Y5SYZ90為動態(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. 比對PC和移動url的結(jié)構(gòu),根據(jù)可替換參數(shù)在步驟1中的位置序號,依次用${1},${2},……表示替換掉移動url 中的可替換參數(shù)或路徑,得到移動url pattern。
移動url pattern:http://m.domain.com/${1}/${2}/${3}.html
提交文件格式
支持以xml文件提交移動適配數(shù)據(jù)。xml文件可提交url一對一對應(yīng)關(guān)系以及url pattern級對應(yīng)關(guān)系,提交數(shù)據(jù)可以是1組或者多組。一個xml文件提交的數(shù)據(jù)上限是1000組
標準xml文件格式示例:
<?xml version="1.0" encoding="UTF-8"?>
<urlset>
<!--表示www.domain.com 下的一組pattern 或url對應(yīng)關(guān)系-->
<url>
<loc>http://www.domain.com/ </loc>
<!-- 表示pc站點的網(wǎng)址首頁 -->
<data>
<display>
<pc_url_pattern>http://www.domain.com/(\d+)/(\d+)/(\w+).html</pc_url_pattern>
<!-- 表示該PC頁的url pattern-->
<xhtml_url_pattern >http://m.domain.com/news/${1}/${2}/${3}.html</xhtml_url_pattern>
<html5_url_pattern >http://m.domain.com/news/${1}/${2}/${3}.html</html5_url_pattern>
<!-- 一組PC pattern 可能含有多個版式的手機頁pattern,視自身情況提交 -->
</display>
</data>
</url>
<!-- 下一組pattern 放在一個新的url 節(jié)點內(nèi) -->
</urlset>
更多幫助請參考 移動適配指南
來源:神馬站長平臺