PHP实现http与https转化
2013-01-03 18:55
597 查看
<?php //http转化为https if ($_SERVER["HTTPS"]<>"on") { $xredir="https://".$_SERVER["SERVER_NAME"]. $_SERVER["REQUEST_URI"]; header("Location: ".$xredir); } ?>
如果网页使用http访问,在网页开头加入以下代码:
<?php //https转化为http if ($_SERVER["HTTPS"]=="on") { $xredir="http://".$_SERVER["SERVER_NAME"]. $_SERVER["REQUEST_URI"]; header("Location: ".$xredir); } ?>
相关文章推荐
- PHP实现http与https转化
- PHP实现http与https转化
- PHP实现http与https转化[原创]
- PHP实现http与https转化
- PHP实现http与https的转化
- PHP实现http与https转化
- PHP实现http与https转化[转张宴]
- PHP实现http与https转化
- HTTP断点续传原理及PHP实现 https://github.com/xfdipzone/11.FileDownload
- php之curl实现http与https请求的方法
- ASP实现https和http之间转化
- php之curl实现http与https请求的方法
- PHP简单实现HTTP和HTTPS跨域共享session解决办法
- php之curl实现http与https请求的方法
- php之curl实现http与https请求的方法
- php之curl实现http与https请求的方法
- ASP实现https和http之间转化
- php之curl实现http与https请求的方法
- PHP简单实现HTTP和HTTPS跨域共享session解决办法
- php之curl实现http与https请求的方法