我在https网站上有一个页面说https://www.example.com
,其中包含一个指向同一网站中另一个php页面target.php
的iframe。
<iframe src="/target.php"></iframe>
此target.php正在将请求重定向到另一个http url使用
header("Location: http://demosite/page" ,TRUE, 307)
不幸的是,这个重定向到http网站的工作不适用于https iframe。虽然它可以在http页面中使用iframe。
我试过了
file_get_contents("http://demosite/page")
并且在target.php
卷曲(而不是标题重定向)。那些没有以适当的格式返回页面。
有人可以告诉我如何在https页面的iframe中显示http页面。
提前致谢 。
在重定向中省略协议。然后它将自动使用用于访问target.php
的相同协议:
header("Location: //demosite/page", true, 307);