Q:

Codeigniter can not find the view file

I am a beginner with the codeigniter, I am trying to render the view file but Codeigniter is not getting the view file. 
My Controller Fucntion 
public function index()
{
    $data['news'] = $this->news_model->getNews();
    $data['title'] = 'Todas as noticias';

    $this->load->view('template/header', $data);
    $this->load->view('news/index', $data);
    $this->load->view('template/footer', $data);
}

My Routing
$route['news/(:any)'] = 'news/view/$1';
$route['default_controller'] = 'news';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

Can anyone figure out what's wrong i have done here ? 

A:

In your routes.php file just remove  $route['news/(:any)'] = 'news/view/$1'; .  CodeIgniter has automatic routing system.  You dont need to specify it.  It is like  example.com/class/function/ID. 
In your case, you can access index function of news controller by typing http://localhost/yourprojectname (since it is your default controller) or by typing http://localhost/yourprojectname/index.php/news. 
Remember you can also remove index.php from your url by using .htaccess file. 
In your .htaccess file copy and paste following line and save it in your project directory
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} ! -f
    RewriteCond %{REQUEST_FILENAME} ! -d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

