PHP header Location: 不适用于 IE
PHP header Location: does not work on IE
header("Location: index.php");
header("Location: /");
header("Location: /",True,301);
.....
在 IE 上没有任何效果,为什么以及如何解决这个问题?
总是在 header('location:url');
之后使用 exit;
。
header("Location: http://example.com/index.php");
exit();
试试这个代码:
ob_start();
header("Location: https://sitename.com/login.php");
exit();
在 header
中传递完整的 URL
。
header("Location: https://yoursite.com/index.php");
header("Location: index.php");
header("Location: /");
header("Location: /",True,301);
.....
在 IE 上没有任何效果,为什么以及如何解决这个问题?
总是在 header('location:url');
之后使用 exit;
。
header("Location: http://example.com/index.php");
exit();
试试这个代码:
ob_start();
header("Location: https://sitename.com/login.php");
exit();
在 header
中传递完整的 URL
。
header("Location: https://yoursite.com/index.php");