CodeIgniter 2.1 issue with show_404() and 404_override

后端 未结 4 1592
抹茶落季
抹茶落季 2020-12-08 15:51

I have been working with CodeIgniter for quite a while now and I\'m currently doing a project for a client that would like a custom 404 pag

4条回答
  •  孤街浪徒
    2020-12-08 16:29

    My fast approach to solving the problem is to create a function in an autoloaded helper file in the project i'm working on. This helper just redirects to the custom 404 page. So i just call show_my_404() instead of show_404()

    function show_my_404(){   
        //Using 'location' not work well on some windows systems
        redirect('controller/page404', 'location');  
    }
    

提交回复
热议问题