将Codeigniter网站从http更改为https网站 - 无法正常工作 [英] Changing Codeigniter site from http to https site - not working

查看:687
本文介绍了将Codeigniter网站从http更改为https网站 - 无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个codeigniter网站,当它在 http 中工作完美。

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

网站到新服务器有 https 安全。

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

这意味着现在网站的URL是 http://mysite.com

That means now the site url is http://mysite.com.

但现在我的网站无法正常运作...

But now my site is not working correctly...

这是什么原因?

这是我的codeigniter网站不能在 https

That is my codeigniter site not working in https.

它只是显示主页,没有jquery效果等不工作..

It just display the home page ,and no jquery effects etc are not working..

我已经改变了config.php中的 base_url https://mysite.com

I already changed the base_url in config.php as https://mysite.com.

推荐答案

尝试此

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

这篇关于将Codeigniter网站从http更改为https网站 - 无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆