I know there are so many posts concering that problem. I tried everything, but without success.
I use xampp v3.2.2 on my windows 10 machine. In my htdocs I got a project called mysite. In there I have codeigniter 3.0.3.
config.php
$config['base_url'] = 'http://localhost/mysite/';
$config['index_page'] = '';
routes.php
$route['default_controller'] = 'CI_home';
Controller CI_home.php:
class CI_home extends CI_Controller{
function __construct() {
parent::__construct();
}
public function index($lang = ''){
$this->load->helper('url');
$this->load->helper('language');
$this->lang->load($lang, $lang);
$this->load->view('view_home');
}
}
When I call http://localhost/mysite
, the page is shown correctly.
The problem is, when I try to http://localhost/mysite/en
or http://localhost/mysite/index/en
I received a 404 from xampp.
But if I try http://localhost/mysite/index.php/CI_home/index/en
it works fine.
What I am doing wrong? How can I remove the "CI_home/index"?
http://localhost/mysite/.htaccess:
.htaccess
RewriteEngine On
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
I already checked if the mod_rewrite is enabled.
Please help me!
Thanks in advance, yab86