一个神奇的 HTTP 跳转:访问域名自动 302 到某个目录内,但点击回"/"却不会再跳转,这是如何实现的?

2016-12-09 22:08:09 +08:00
 terence4444
例子: https://www.humblebundle.com/
现在进入站点后会自动 302 到 https://www.humblebundle.com/books/neil-gaiman-book-bundle
现在如果:
1. 点击 Game Bundles ,页面上显示的 a href = "/",会先重定向到 https://www.humblebundle.com/ 然后再跳转到 https://www.humblebundle.com/tycoon-simulator-bundle
2. 再次在浏览器地址栏中输入 https://www.humblebundle.com/,还是被重定向到 https://www.humblebundle.com/books/neil-gaiman-book-bundle

请问,这种访问同一个地址跳转到不同目录是如何实现的?
2717 次点击
所在节点    问与答
5 条回复
lhbc
2016-12-09 22:10:56 +08:00
referrer
sciooga
2016-12-09 22:15:21 +08:00
@lhbc 是 Referer 不是 Referrer ,相信你懂的。
a67793581
2016-12-09 22:16:17 +08:00
终结~······
terence4444
2016-12-09 22:20:55 +08:00
@lhbc
@sciooga

果然是,我在 HTTP 头里伪造了一个 'Referer',="https://www.humblebundle.com/" 就跳转到 1 的地方去了。
非常感谢。
lhbc
2016-12-09 23:29:31 +08:00
@sciooga 一开始拼错成 referer 了,现在两个好像都可以用的?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/326544

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX