【发布时间】:2012-08-20 19:57:06
【问题描述】:
我正在编写一个 PHP 代码,并且有 header('Location: '.$location, TRUE, 200);,它没有重定向到 $location(这里的值是“https://thepiratebay.se/”)。我已经列出了所有存在的标题,请帮助。
如您所见,Location 标头存在但未重定向到。为什么?
经过测试的浏览器:Chrome、Firefox、IE、Safari。
标题是(如 Chrome 所示):
HTTP/1.1 200 OK
Date: Sat, 25 Aug 2012 15:10:54 GMT
Server: Apache/2.4.2 (Win32) PHP/5.4.4
X-Powered-By: PHP/5.4.4
Location: https://thepiratebay.se/
Content-Length: 5935
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html
【问题讨论】:
-
如果浏览器没有重定向,这不是 PHP 的错。显然,
header()调用做得很好。
标签: php redirect header location