I have been working with codeigniter for a long time. I have set my default controller to:
$route['default_controller'] = "main";
everything is fine, except I have created a function in main.php
controller file that redirects to 404 Not Found page.
This is my code in main.php:
function not_found()
{
$data['page_Title'] = '404 Error!';
$data['page_Description'] = 'Description';
$data['page_Keywords'] = 'Keywords';
$data['main_content'] = 'not_found';
$this->load->view('includes/template', $data);
}
Then when I want to load example.com/not_found/
it redirects me to the codeigniter's default not found page and says:
404 Page Not Found
The page you requested was not found.
but, there is no problem requesting the page like:
example.com/main/not_found/
Do I have to set another route like:
$route['not_found'] = "main/not_found";
?! but this is not a good way I think!