terence4444
V2EX  ›  问与答

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

  •  
  •   terence4444 · Dec 9, 2016 · 3360 views
    This topic created in 3615 days ago, the information mentioned may be changed or developed.
    例子: 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

    请问,这种访问同一个地址跳转到不同目录是如何实现的?
    5 replies  •  2016-12-09 23:29:31 +08:00
    lhbc
    lhbc
    Dec 9, 2016 via Android❤️1
    1
    referrer
    sciooga
    sciooga
    Dec 9, 2016❤️1
    2
    @lhbc 是 Referer 不是 Referrer ,相信你懂的。
    a67793581
    a67793581
    Dec 9, 2016
    3
    终结~······
    terence4444
    terence4444
    OP
    Dec 9, 2016
    4
    @lhbc
    @sciooga

    果然是,我在 HTTP 头里伪造了一个 'Referer',="https://www.humblebundle.com/" 就跳转到 1 的地方去了。
    非常感谢。
    lhbc
    lhbc
    Dec 9, 2016 via Android❤️1
    5
    @sciooga 一开始拼错成 referer 了,现在两个好像都可以用的?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5671 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 02:24 · PVG 10:24 · LAX 18:24 · JFK 21:24
    ♥ Do have faith in what you're doing.