APPLY FOR ONLINE Zend Framework Certification

                    
                          How to setup a 404 page in CodeIgniter website
----------------------------------------------------------------
Step 1 
        $route['404_override'] = 'page404';    //page404 is class name. 

Step 2
        Create a new controller

<?php 
class page404 extends CI_Controller 
{
    public function __construct() 
    {
        parent::__construct(); 
    } 

    public function index() 
    { 
        $this->output->set_status_header('404'); 
        $data['content'] = 'error_404'; 
        $this->load->view('index',$data);
    } 
} 
?>                     
                


Comment


Back to Top