PHP实现http与https转化
来源:互联网 发布:linux date 北京时间 编辑:程序博客网 时间:2024/06/05 10:26
如果网页使用https访问,在网页开头加入以下代码:
1
2
3
4
5
6
7
8
<!--?php <br ?-->
//http转化为https
if
(
$_SERVER
[
"HTTPS"
]<>
"on"
)
{
$xredir
=
"https://"
.
$_SERVER
[
"SERVER_NAME"
].
$_SERVER
[
"REQUEST_URI"
];
header(
"Location: "
.
$xredir
);
}
?>
如果网页使用http访问,在网页开头加入以下代码:
1
2
3
4
5
6
7
8
<!--?php <br ?-->
//https转化为http
if
(
$_SERVER
[
"HTTPS"
]==
"on"
)
{
$xredir
=
"http://"
.
$_SERVER
[
"SERVER_NAME"
].
$_SERVER
[
"REQUEST_URI"
];
header(
"Location: "
.
$xredir
);
}
?>
0 0
- PHP实现http与https的转化
- PHP实现http与https转化
- PHP实现http与https转化
- PHP实现http与https转化
- PHP实现http与https转化
- ASP实现https和http之间转化
- php之curl实现http与https请求的方法
- PHP之curl实现http与https请求的
- php之curl实现http与https请求的方法
- php http与https转换
- http转化为https
- Java实现http与https切换
- charles实现http与https抓包
- 自己动手利用Socket 实现HTTP与HTTPS
- php curl http https
- PHP + curl 实现 http 或 https 抓取数据:
- 在http和https之间转化
- 在http和https之间转化
- python 中 字符串的应用
- HDU
- at 17:00 Shutdown -s -t 60
- 深入理解拉格朗日乘子法(Lagrange Multiplier) 和KKT条件
- Controlled-Channel Attacks: Deterministic Side Channels for Untrusted Operating Systems
- PHP实现http与https转化
- springmvc返回路径错误的问题
- ESB和SOAP的概念
- iOS中的RunLoop
- android ffmpeg neno优化
- 黑匣子
- Dubbo+Zookeeper+Spring整合应用篇-Dubbo基于Zookeeper实现分布式服务
- Autofuc None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructor
- OC--NSMutableString可变字符串