I’m developing an application based on Ubuntu & Apache2 & CodeIgniter
I’ve a controller named Site like this
class Site extends CI_Controller {
public function view($page = 'home')
{
$this->load->view('site/'.$page, $data);
}
}
in application/views/site I have home.php & about.php
localhost/index.php/about works well
but localhost/about gets
Not Found,The requested URL /about was not found on this server.
I’ve already
- make sure
mod_rewriteturned on andAllowOverride Allin apache2 config file. $config['index_page'] = '';inapplication/config/config.php
I’ve also set route to
$route['default_controller'] = "site/view";
$route['404_override'] = '';
$route['(:any)'] = "site/view/$1";
Here’s my .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
<Files "index.php">
AcceptPathInfo On
</Files>
This is the .htaccess I am using (on Yii, but should be interchangable):
Almost identical to yours