HTTP响应标题:多个链接值 [英] HTTP response headers: multiple Link values

查看:100
本文介绍了HTTP响应标题:多个链接值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Rails应用程序开发SEO。

I'm working on SEO for a Rails App.

该网站完全本地化,我遵循此Google文章为网页添加 hreflang备用链接。

The website is fully localized, and I'm following this google article to add hreflang alternate links to the pages.

< head> 中的HTML链接都可以。

The HTML links in the <head> are ok.

I在响应标题中遇到麻烦。

据我所知,我应该为每个备选版本的页面提供值,但我不确定如何设置多个值。

I understand that I'm supposed to provide values for each alternative version of the page, but I'm not sure about how to set multiple values.

我试图将它们作为逗号分隔列表传递。浏览器似乎可以正确接收它,但是由于各个值包含分号,因此它看起来错误

I tried to pass them as a comma separated list. Browsers seem to receive it correctly, but since individual values contain semi-colons it looks wrong.

是否有任何参考?
即使是已知正确实现它的示例网页也会有所帮助。

Is there any reference on it? Even an example webpage that is known to implement it correctly would help.

推荐答案

我没有这方面的经验,但根据同一RFC中的示例,它们以逗号分隔:

I have no experience with this, but according to the examples in the same RFC they get separated by comma:

Link: </TheBook/chapter2>;
      rel="previous"; title*=UTF-8'de'letztes%20Kapitel,
      </TheBook/chapter4>;
      rel="next"; title*=UTF-8'de'n%c3%a4chstes%20Kapitel

a href =http://tools.ietf.org/html/rfc5988#section-5.3> 5.3 (强调我的):

It’s indirectly confirmed by 5.3 (emphasis mine):


请注意,扩展关系类型必须是链接标题中的绝对URI,并且如果它们包含分号(;)或逗号(,)(,因为使用这些字符时必须加引号作为标题本身的分隔符)。

这篇关于HTTP响应标题:多个链接值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆