Codeigniter & PHP - forcing a 404?

后端 未结 8 1352
予麋鹿
予麋鹿 2020-12-08 10:19

In codeigniter, as you know, a page of the form: /class/function/ID, where class is the controller name, function is the method within the controller, and ID is

8条回答
  •  失恋的感觉
    2020-12-08 10:57

    Yes show_404() WILL send out a 404 but it looks like hell. There have been a few hacks suggested here, but why hack when you can use built in features?

    Upgrade to CI 2.0 and you'll be able to use the amazing:

    $route['404_override'] = 'errors/error_404';
    

    Then you can have a general errors controller without having to worry about trying to load views, libraries and helpers WY too early in the CI instance to function properly.

提交回复
热议问题