【问题标题】:Pointing out the mobile optimized page in desktop version(html)指出桌面版移动优化页面(html)
【发布时间】:2015-01-08 17:06:40
【问题描述】:

我有一个专为桌面设备设计和优化的页面foo.bar/root,现在我想告诉搜索引擎m.foo.bar/m-root 是同一个页面,但针对移动设备进行了优化,我该怎么做?
我应该在我的回复中添加什么样的标签(或 http 标头)来告诉亲爱的 Google 索引移动优化页面?

【问题讨论】:

标签: html http seo googlebot


【解决方案1】:

alternate link type“创建一个引用当前文档的替代表示的超链接”。使用link 元素,它可能看起来像:

<!-- on the desktop page <http://example.com/foo/> -->
<link href="http://m.example.com/foo/" rel="alternate">

您还可以使用media attribute 指定“资源适用于哪个媒体”(根据自己的喜好调整媒体查询):

<!-- on the desktop page <http://example.com/foo/> -->
<link href="http://m.example.com/foo/" rel="alternate" media="only screen and (max-width: 640px)">

这是普通的 HTML5 方式。

根据Google’s documentation,Google 似乎也能识别此标记。

【讨论】:

  • 完美,非常感谢先生,但是根据rel="alternate" 用于指出当前页面的替代页面(通常是不同的语言),我真的没有找到并知道media attr 先生,非常感谢。
猜你喜欢
  • 1970-01-01
  • 2013-01-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-08-20
相关资源
最近更新 更多