Question: I am tring to create default controller for no matter what URL you access to.  

Meaning, custom 404.

```
class MY_Exceptions extends CI_Exceptions
{
var $ci;

public function __construct()
{
    parent::CI_Exceptions();
    $this->ci =& get_instance();
}

function show_404($page = '')
{
  //load view here

}

```

} 

I am getting get\_instance is undefined. (because it was defined after the libraries get called)  

Is there a way to create custom 404 controller in codeignigter 1.7.2 without playing with the system core code. 

Thanks

Answer: 
[Upgrade to CodeIgniter 2.0](http://philsturgeon.co.uk/news/2010/05/upgrading-to-codeigniter-2.0) because [its stable](http://philsturgeon.co.uk/news/2010/10/codeigniter-2.0-is-stable) and use:

```
$route['404_override'] = '';

```
This should work fine. Make sure it's in the 'application/libraries' folder, and make sure your config has 'MY\_' set as the custom library name.

Also, if you are doing `function __construct(){}`, you can do `parent::__construct()`.