Changing Codeigniter site from http to https site - not working

前端 未结 1 1510
伪装坚强ぢ
伪装坚强ぢ 2021-01-28 05:32

I have a codeigniter site ,that working perfectly when it is in http.

Then our client moved the site to new server which have the https securit

1条回答
  •  醉话见心
    2021-01-28 06:11

    Try this

    function redirectToHTTPS()
    {
      if($_SERVER['HTTPS']!="on")
      {
         $redirect= "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
         header("Location:$redirect");
      }
    }
    

    0 讨论(0)
提交回复
热议问题