I'm learning Code Igniter. Basically what I want to do is to show a *404* error message when users go to a URL that does not exist in `views` directory. 

So I made a new file at `application/controllers/` called `Pages.php` which goes like this:

```
<?php
class Pages extends CI_Controller
{
    public function view($page = 'home')
    {
        if(!file_exists(APPPATH.'views/pages/'.$page.'.php'))
        {
            show_404();
        }

        $data['title'] = ucfirst($page);

        $this->load->view('templates/header');
        $this->load->view('pages/'.$page, $data);
        $this->load->view('templates/footer');
    }
}
?>

```

Then I created a folder named `templates` at *views* directory which contains a `header.php` file and a `footer.php` file. And I created also a `pages` folder under the same directory. 

So what I should get is a **404 Page Not Found** message when I go to a custom URL such as `http://localhost/codeigniter/pages/about` which does not exist yet. 

But the problem is, the browser shows me **Object not found!** rather than that. 

So what is wrong with this, how can I fix this issue?