I created the file MY_Router.php
inside the core directory with this code:
<?php
class MY_Router extends CI_Router {
function MY_Router()
{
parent::CI_Router();
}
function _validate_request($segments)
{
// Comprueba que el controlador no existe
if (!file_exists(APPPATH.'controllers/'.$segments[0].EXT))
{
$segments = array("page", "load", $segments[0]);
}
return parent::_validate_request($segments);
}
}
?>
When I call the application, this error appears:
Fatal error: Call to undefined method CI_Router::CI_Router() in /home/david/public_html/CodeIgniter_2.1.0/application/core/MY_Router.php on line 6
Where is the problem?