I have the following problem with CodeIgniter. I'm trying to setup a menu, and using route config to load the proper content but from some reason it's not working.
I have CodeIgniter setup under:
http://localhost/new/CodeIgniter/
My config file looks like this:
$config['base_url'] = 'http://localhost/new/CodeIgniter/';
$config['index_page'] = '';
My route config looks like this:
$route['default_controller'] = 'Home/home';
$route['404_override'] = '';
$route['home'] = 'Home/home';
$route['compare'] = 'Home/home';
$route['signin'] = 'Home/home';
$route['translate_uri_dashes'] = FALSE;
And this is my Home controler:
class Home extends CI_Controller {
public function __construct()
{
parent::__construct();
}
public function index()
{
$this->home();
}
public function home()
{
$this->load->model('home_model');
$this->load->view('header_view', $data);
$this->load->view('nav_view', $data);
$this->load->view('home_view', $data);
$this->load->view('footer_view', $data);
}
public function compare()
{
$this->load->model('home_model');
$this->load->view('header_view', $data);
$this->load->view('nav_view', $data);
$this->load->view('home_view', $data);
$this->load->view('footer_view', $data);
}
public function signin()
{
$this->load->model('home_model');
$this->load->view('header_view', $data);
$this->load->view('nav_view', $data);
$this->load->view('home_view', $data);
$this->load->view('footer_view', $data);
}
public function about()
{
$this->load->model('home_model');
$this->load->view('header_view', $data);
$this->load->view('nav_view', $data);
$this->load->view('home_view', $data);
$this->load->view('footer_view', $data);
}
}
When I access http://localhost/new/CodeIgniter/ I can see the home page, but none of the following are working:
http://localhost/new/CodeIgniter/home
http://localhost/new/CodeIgniter/compare
http://localhost/new/CodeIgniter/signin
http://localhost/new/CodeIgniter/about
Does anyone has any idea what I'm doing wrong here?
The error is the following:
Not Found
The requested URL /new/CodeIgniter/home was not found on this server.
This is my httaccess
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
<IfModule ModRewite>
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>