We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Multilingual

Hello guys. I am new in phalcon and i am trying to make invo multilingual. I want my pages to redirect when they hit https://localhost/phalcon to https://localhost/phalcon/en and etc...
i used the routes in the app/config/routes.php $router = new Phalcon\Mvc\Router();

$router->removeExtraSlashes(true);

$router->add('/{language:[a-z]+}/:controller/:action', array(
    'controller' => 2,
    'action' => 3
));

$router->add('/{language:[a-z]+}/:controller/:action/:params', array(
    'controller' => 2,
    'action' => 3,
    'params' => 4
));

return $router;

After i used in app/config/routes.php $di->set('router', function(){ require DIR.'/routes.php'; return $router; });

What i am missing and i didin't understand? Thank you for your help!

You didn't actually state what your problem was, or what was happening.

Hello thanks for you reply. So i have the https://localhost/invo/index/index and its working when i am doing https://localhost/invo/en/index/index page not found and don't have access. I used dimopoulos function but when i put index too function in the router i take that website not found internal error. The problem is that i use the acl of invo and i take not authorized.