301 重定向是否始终保留引荐来源网址? [英] Does 301 redirect always preserve referrer?

查看:24
本文介绍了301 重定向是否始终保留引荐来源网址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道 301 重定向是否总是保留引用.

I want to know whether 301 redirect always preserve referrer.

我创建了一个名为gotoorig_https.html"的页面,其中包含一个指向页面orig_https.asp"的超链接.
orig_https.asp"将 301 重定向到dest.html",其中显示了 document.referrer.

I make a page called "gotoorig_https.html" which contains a hyperlink to a page "orig_https.asp".
"orig_https.asp" will 301 redirect to "dest.html" which shows the document.referrer.

在这种情况下,

http page(gotoorig_https.html) -> orig_https.asp(301 redirect)-> https page (dest.html) <--the referrer preserves  
https page(gotoorig_https.html) -> orig_https.asp(301 redirect)-> https page (dest.html) <--the referrer preserves  

我还制作了一个名为gotoorig_http.html"的页面,其中包含一个指向orig_http.asp"页面的超链接.orig_http.asp"将 301 重定向到dest.html",其中显示了 document.referrer.

I also make a page called "gotoorig_http.html" which contains a hyperlink to a page "orig_http.asp". "orig_http.asp" will 301 redirect to "dest.html" which shows the document.referrer.

在这种情况下,

http page(gotoorig_http.html) -> orig_http.asp(301 redirect)-> http page (dest.html) <--the referrer preserves  
https page(gotoorig_http.html) -> orig_http.asp(301 redirect)-> http page (dest.html) <--the referrer DOES NOT preserve.

为什么最后一种情况会发生?

Why does the last case happen?

推荐答案

RFC 没有在状态 301 定义中指定任何特定于引用者的行为,也没有在 Referer 标头定义中指定任何特定于 301 的行为.因此,我不得不说,虽然这种保留引用的行为是合乎逻辑的,但它并未在 RFC 中定义,因此您永远无法确定.

RFC doesn't specify any referrer-specific behavior in status 301 definition, nor 301-specific behavior in Referer header definition. Thus, I have to say that although this referrer-preserving behavior is logical, it is not defined in RFC and thus you can never be sure.

这篇关于301 重定向是否始终保留引荐来源网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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