问题描述
我在 1 个客户端上遇到了一个奇怪的问题,其中 307 重定向以某种方式被 chrome 浏览器缓存(仅发生在 1 个客户身上,但在他们的很多机器上)。我假设不应缓存 307 重定向。
我正在执行重定向以有时强制执行 https;但是如果我关闭重定向,它最终仍然会转到 https://example.com/temp
(在第二次访问 http://example.com/ 之后,代码上没有重定向)
这是我如何进行重定向
当前网址 = 'http://example.com/'
$new_url = 'https://example.com/temp';
header('HTTP/1.1 307 Temporary Redirect');
header('Cache-Control: no-cache,no-store,must-revalidate'); // HTTP 1.1.
header('Pragma: no-cache'); // HTTP 1.0.
header('Expires: 0'); // Proxies.
header("Location: $new_url",TRUE,307);
exit();
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)