PC+手机模版的代码设置

Web176

通过上面思维导图可以大体了解PC+手机模版的代码设置的内容和目的。

本文重点介绍做SEOPC+手机模版的代码设置:

1、pc网站每个页面头部文件填写3行代码。

2、手机网站每个页面头部文件填写2行代码。

举个例子:

PC端:https://www.web176.com/,手机端:https://m.web176.com/ ,PC端和手机端是两套模板。

第一步:针对PC端需要写三行代码,写在头部文件即可

<metaname="applicable-device"content="pc">

<meta name="mobile-agent" content="format=html5;url=https://m.web176.com/">

<link rel="alternate" media="only screen and(max-width:640px" href="https: //m.web176.com/ ">

第二步:针对手机端需要写两行代码,写在头部文件即可

<meta name="applicable-device" content="mobile">

<link rel="canonical" href="https://www. web176.com/ ">

第三步:打开百度资源管理平台,进行适配

网址:https://ziyuan.baidu.com/mobiletools/index

将自己网站同一链接的PC端和手机端链接进行提交适配。

作者:clldo,如若转载,请注明出处:https://www.web176.com/news/promotion/24848.html

(2)
打赏 支付宝 支付宝 微信 微信
clldoclldo
上一篇 2023年7月29日 上午11:12
下一篇 2023年7月29日 上午11:52

相关推荐

发表回复

登录后才能评论