doufangzhang4454 2014-01-17 19:33
浏览 29
已采纳

codeigniter中的语言没有按预期工作

I have a web site with two languages, it works in localhost perfect. but when I run it on a production enviroment and people try to change the language doesn't work, they need to press F5 key in the browser,so then the site reload in the language they choose. Any idea?? Thanks...

public function __construct()
    {
        parent::__construct();     
        $this->lang->load('navmenu', $this->session->userdata('language'));
        $this->lang->load('search', $this->session->userdata('language'));
        $this->lang->load('home', $this->session->userdata('language'));
    }

/.../
function ChangeLanguage ($lang)
    {
        $this->session->set_userdata('language', $lang);
        redirect(base_url());
    }

  anchor('lang/changelanguage/spanish','Español')  
   anchor('lang/changelanguage/english','English')
  • 写回答

1条回答 默认 最新

  • duanpa5237 2014-02-18 08:00
    关注

    to debug this in production server, you can temporary put

    error_reporting(E_ALL);
    

    and see what other errors are there that prevents the proper redirecting. You also should check the response headers being sent by your production server. Does it have "cache", does it need re-validate header, etc

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持