首页 > 解决方案 > How to have AMP site working only for mobile and Desktop for normal desktop users

问题描述

We are pretty new to AMP setup and we are trying to move to AMP site only for mobile users.

We want our desktop site to be used as is for desktop user and when a mobile user search for that page it should give AMP page in search result.

My question is, is it the core behavior of AMP or do we need to have some kind of redirect setup based on screen size?

I know the tag is used to define the amp and non-amp site on them but does that mean that when a user search that page in desktop google search he/she will get only AMP page in search result?

标签: amp-html

解决方案


在您的情况下,您需要创建两个不同的 url,一个用于桌面,另一个用于移动:

例如

桌面网址:https ://www.example.com/home.html

AMP 网址:https ://www.example.com/home-amp.html

现在让您的页面可被发现

将以下内容添加到非 AMP 页面(桌面) - 在 home.html 文件中:

 <link rel="amphtml" href="https://www.example.com/home-amp.html">

这到 AMP 页面 - 在 home-amp.html 文件中:

<link rel="canonical" href="https://www.example.com/home.html">

欲了解更多信息,请单击此处


推荐阅读