I started using the first sample tutorial at http://ellislab.com/codeigniter%20/user-guide/tutorial/static_pages.html .
I always get a problem with the page not found! I have read many articles to solve the problem. But no matter how often I try solutions in different forums, it does not work!
Can someone please tell me where my errors are?
So these are some files I tried:
My .php routes in / config application
$route['default_controller'] = "pages/view";
$route['404_override'] = '';
$route['(:any)'] = 'pages/view/$1';
My .php pages in application / controllers
<?php
class Pages extends CI_Controller{
public function view($page = "home")
{
if ( ! file_exists('application/views/pages/'.$page.'.php'))
{
show_404();
}
$data['title'] = ucfirst($page);
$this->load->view('templates/header', $data);
$this->load->view('pages/'.$page, $data);
$this->load->view('templates/footer', $data);
}
}
My home.php and about.php are in the app / views / pages /
and header.php and footer.php are in the app / views / templates /
Many thanks!