网站制作学习网PHP→正文:php http跳转到https
字体:

php http跳转到https

PHP 2015/3/10 23:38:50  点击:不统计


 怎么实现http跳转到https呢,很简单的php代码,实现了从http跳转到https。

<?php
if($_SERVER['HTTPS']!='on'){
  redirect('https://www.forasp.cn'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
}
?>
 
这样实现了http到https的跳转

原文章%77w%77%2Ef%6F%72%61%73%70%2E%63n

·上一篇:mysql备份,热备份,数据同步 >>    ·下一篇:Thinkphp用Redis存储session >>
推荐文章
最新文章