首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >正确使用链接hreflang

正确使用链接hreflang
EN

Stack Overflow用户
提问于 2015-05-18 20:37:45
回答 1查看 427关注 0票数 0

我用下面的链接标签表示多种语言,有两个问题

  1. 我应该在url http://domain.com/?hl=enhttp://domain.com/?hl=es中添加http://domain.com/?hl=en
  2. 我应该在url http://domain.com/?hl=en中添加<html lang='en'>,在http://domain.com/?hl=es中添加<html lang='es'>吗?
代码语言:javascript
复制
<head>
  <!-- … -->
  <link href="http://domain.com/" hreflang="x-default" rel="alternate">
  <link href="http://domain.com/?hl=en" hreflang="en" rel="alternate">
  <link href="http://domain.com/?hl=es" hreflang="es" rel="alternate">
</head>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-05-19 08:23:11

  1. 我应该在url href=或http://domain.com/?hl=es中添加< link http://domain.com/?hl=enhttp://domain.com/”rel=“正则”>

两者都不能使用:

代码语言:javascript
复制
<link href="http://domain.com/" rel="canonical"> in http://domain.com/
<link href="http://domain.com/?hl=en" rel="canonical"> in http://domain.com/?hl=en
<link href="http://domain.com/?hl=es" rel="canonical"> in http://domain.com/?hl=es
  1. 我应该在url http://domain.com/?hl=enhttp://domain.com/?hl=es中添加< html lang='en‘>

您可以将其放在http://domain.com/?hl=en中,但不能放在http://domain.com/?hl=es中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30312413

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档