【发布时间】:2012-05-24 22:40:21
【问题描述】:
如何重定向用户并确保 HTTP_REFERER 在到达名为 redirect.php 的页面后不会转移到下一页。
程序流程如下:
1) 在http://example.com/index.php 的页面上(包含指向redirect.php 的链接)
2) 用户点击redirect.php的链接,它会发送header('Location: http://otherlocation.com/index.php');
3) 我需要阻止 otherlocation.com 看到来自 http://example.com/index.php 的 HTTP_REFERER
我试过了:
header('Location:redirect.php');
这不起作用,因为 HTTP_REFERER 填充了第一页 (http://example.com/index.php) 中的值。
【问题讨论】:
-
问题表述不清楚。你想让我做什么 ?另外,你试过什么??
-
对不起我的英语,很难描述。我添加了一些详细的说明,逐步说明我的工作和需要。
-
@abrahab,更新了我的答案,查看新代码。
-
@IbrahimAzharArmar 请给我一些时间。您是否 100% 确定 302 重定向将提供
redirect.php的 HTTP_REFERER,但不会提供http://domain.com/index.php的 HTTP_REFERER? -
@abraab 在这里检查这个链接。 dankind.com/blog/hiding-the-http-referer-with-php-js-or-meta,我试过了,对我来说效果很好。