百度对PC、Html5页跳转适配推出了SEO最优方案

2015年6月14日09:03:31网站建设1 649

鉴于移动化大潮的汹涌和Html5页的炫丽普及,很多的站点采用Html5页面作为站点的移动页面,在PC页通过js等进行判断,跳转到移动页面,但是这种方法对于搜索引擎的并不好友好,除非你向搜索引擎提交pc页与移动页的对应关系或者搜索引擎支持js渲染。针对此问题,百度推出了针对PC页与Html5页的跳转适配方式的SEO最优方案:在pc版网页上,添加指向对应移动版网址的特殊链接rel="alternate"标记,这有助于百度发现网站的移动版网页所在的位置;同时在移动版网页上,添加指向对应pc版网址的链接rel="canonical"标记。文章源自堕落的鱼-https://www.duoluodeyu.com/1492.html

具体示例如下:文章源自堕落的鱼-https://www.duoluodeyu.com/1492.html

pc版网址:http://www.example.com/page-1文章源自堕落的鱼-https://www.duoluodeyu.com/1492.html

移动版网址:http://m.example.com/page-1文章源自堕落的鱼-https://www.duoluodeyu.com/1492.html

那么此示例中的注释如下所示:文章源自堕落的鱼-https://www.duoluodeyu.com/1492.html

在pc版网页(http://www.example.com/page-1) 上,添加:文章源自堕落的鱼-https://www.duoluodeyu.com/1492.html

<link rel="alternate" media="only screen and(max-width: 640px)"     href="http://m.example.com/page-1" >文章源自堕落的鱼-https://www.duoluodeyu.com/1492.html

在移动版网页(http://m.example.com/page-1) 上,所需的注释应为:文章源自堕落的鱼-https://www.duoluodeyu.com/1492.html

<link rel="canonical"href="http://www.example.com/page-1" >文章源自堕落的鱼-https://www.duoluodeyu.com/1492.html

备注:百度之前的Meta标记(mobile agent)会继续沿用,但是建议使用HTMAL5语言制作的移动页面使用以上最新方案进行跳转适配。其它如xml语言的移动页跳转适配,需要继续使用之前的meta标记方式——<meta name="mobile-agent"content="format=[wml|xhtml|html5]; url=url">。文章源自堕落的鱼-https://www.duoluodeyu.com/1492.html

匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定

评论:1   其中:访客  1   博主  0
    • 烈火
      烈火 0

      现在不用这么折腾了,我用了跨屏网针对dedecms织梦提供的免费方案,在网站添加一句js,即可快速适配手机