index 頁面
<meta name="mobile-agent" content="format=html5;url=http://m.tiyudiban.com.cn">
<meta name="mobile-agent" content="format=xhtml;url=http://m.tiyudiban.com.cn">
<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.tiyudiban.com.cn" />
<meta http-equiv="mobile-agent" content="format=wml; url=http://m.tiyudiban.com.cn">
分類頁面:
<meta name="mobile-agent" content="format=html5;url=http://m.tiyudiban.com.cn{dede:type typeid='0' row=1}[field:typelink/]{/dede:type}">
<meta name="mobile-agent" content="format=xhtml;url=http://m.tiyudiban.com.cn{dede:type typeid='0' row=1}[field:typelink/]{/dede:type}">
<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.tiyudiban.com.cn{dede:type typeid='0' row=1}[field:typelink/]{/dede:type}" />
<meta http-equiv="mobile-agent" content="format=wml; url=http://m.tiyudiban.com.cn{dede:type typeid='0' row=1}[field:typelink/]{/dede:type}">
這裏的typeid='0′row=1 即表示獲取當前欄目頁的地址,這個方法通用語頂級欄目頁和次級欄目頁。
內容頁面:
<meta name="mobile-agent" content="format=html5;url=http://m.tiyudiban.com.cn{dede:field name='arcurl'/}">
<meta name="mobile-agent" content="format=xhtml;url=http://m.tiyudiban.com.cn{dede:field name='arcurl'/}">
<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.tiyudiban.com.cn{dede:field name='arcurl'/}" />
<meta http-equiv="mobile-agent" content="format=wml; url=http://m.tiyudiban.com.cn{dede:field name='arcurl'/}">
針對不同的移動端網站,我們還需要做下applicable-device標註聲明,主要根據自己網站的情況分以下幾種,請結合自己的網站情況使用:
僅PC協議(添加在獨立pc頁面頭部) <meta name="applicable-device" content="pc">
僅PH協議 (添加在移動端網站頁面頭部) <meta name="applicable-device"content="mobile">
自適應協議 (添加在獨立pc頁面頭部) <meta name="applicable-device"content="pc,mobile">