I am trying to create a typical routing setting.
Use Autorouting so that domain.com/ - goes to index controller and index action domain.com/my_conroller/my_action - goes and executes my_controller and my_action - Pretty straight forawrd and works automatically with the autorouting.
Now comes the need. Any request to : domain root level should always call the index controller and index action if controller/action do not exist.
Say for example when Calling : mydomain.com/abcdxyz (controller abcdxyz does not exist and will never).
It should load up the index controller and do the index action automatically.
$router = new \Phalcon\Mvc\Router(false); //and setting up :
$router->notFound(array(
"controller" => "index",
"action" => "index"
));
is not the solution, since it will break the auto trouting. I need the autorouting to work automaically based on what exists. Only when controller/action does snot exist, I would want to always use the index/index controller/function.
Any insights on how this can be achieved ?