(轉) 移動站適配rel=alternate PC頁和H5頁適配標註

來源:互聯網
上載者:User

標籤:str   dia   log   移動化   info   pos   img   html   screen   

轉自 https://www.cnblogs.com/osfipin/p/5852037.html

 

鑒於移動化大潮的洶湧和H5頁的炫麗普及,百度針對PC頁與H5頁的跳轉適配方式推出了最優方案:
1.在pc版網頁上,添加指向對應移動版網址的特殊連結rel="alternate"標記,這有助於百度發現網站的移動版網頁所在的位置;
2.同時在移動版網頁上,添加指向對應pc版網址的連結rel="canonical"標記。

電腦端網站:

移動端網站:

如果你的網址是:
pc版網址:http://pc_url
移動版網址:http://mobile_url


那麼此樣本中的注釋如下所示:
在pc版網頁(http://pc_url) 上,添加:

<link rel="alternate" media="only screen and(max-width: 640px)" href="http://pc_url" >

在移動版網頁(http://mobile_url) 上,所需的注釋應為:

<link rel="canonical" href="http://mobile_url" >

之前的Meta標記(mobile agent)會繼續沿用,但我們推薦使用HTMAL5語言製作的移動頁面使用最新方案進行跳轉適配,其它如xml語言的移動頁跳轉適配,需要繼續使用之前的meta標記方式:

<meta name="mobile-agent"content="format=[wml|xhtml|html5]; url=mobile_url">

 

 

(轉) 移動站適配rel=alternate PC頁和H5頁適配標註

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.