HTTP 到 HTTPS 重定向在使用 PHP 的 Apache 上不起作用
我有一个脚本,可以处理服务器上的多个不同重定向,其代码片段如下所示:
if($url == "http://www.url.com")
{header("Location: https://www.url.com/index.html");}
该脚本在解决一个问题时完全按照预期工作 - 所有 https 重定向最终都重定向到 http(与定义的 https 相对)。
有人知道可能发生什么吗?
I have a script that handles several different redirects on a server with a snippet that looks like follows:
if($url == "http://www.url.com")
{header("Location: https://www.url.com/index.html");}
The script works exactly as intended with one issue - all of the https redirects end up redirecting to http (versus the https as defined).
Does anyone have any ideas what may be going on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您重定向到的服务器有自己的 http 重定向。
除非您正在管理该服务器,否则您对此无能为力。
The server you redirect to has a redirect of its own to http.
Nothing you can do about it, unless you are administering that server.
服务器还发生了其他事情,但已经有一段时间了,所以我不记得那是什么了。
There was something else going on with the server, but it's been a while so I can't remember what it was anymore.