Add this handler to your application bootstrap. And modify following forward path as you want
$eventsManager = new \Phalcon\Events\Manager();
$eventsManager->attach("dispatch", function($event, $dispatcher, $exception) use ($di) {
if ($event->getType() == 'beforeException') {
switch ($exception->getCode()) {
case \Phalcon\Dispatcher::EXCEPTION_HANDLER_NOT_FOUND:
case \Phalcon\Dispatcher::EXCEPTION_ACTION_NOT_FOUND:
$dispatcher->forward(array(
'controller' => 'YOUR_CONTROLLER',
'action' => 'YOUR_ACTION,
....'
));
return false;
}
}
});
//Bind the EventsManager to the dispatcher
$dispatcher->setEventsManager($eventsManager);
$di->setShared('dispatcher', $dispatcher);