Followed the steps of another SO question on how to remove index.php from CI3.0 urls. Everything works fine except other pages now throw 404.
URL Before: domain.com/index.php/about.php After: domain.com/about.php <- Throw 404
The default page however still works but as soon as i try to navigate to another page, 404...
Controller:
<?php
class Pages extends CI_Controller
{
public function view($page = 'home')
{
if ( ! file_exists(APPPATH.'views/pages/'.$page.'.php')) {
show_404();
}
$data['title'] = ucfirst($page);
$this->load->helper('url');
$this->load->view('templates/header', $data);
$this->load->view('pages/'.$page, $data);
$this->load->view('templates/footer', $data);
}
}
Router:
$route['default_controller'] = 'pages/view';
$route['about'] = 'pages/view/about';
$route['(:any)'] = 'pages/view/$1';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
Config:
$config['index_page'] = '';
.htaccess:
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]