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

Language slug URL redirects

Any ideas on how to redirect generic calls (that do not contain the language slug) such as https://site.tld/ or https://site.tld/controller/action to https://site.tld/LANG/ or https://site.tld/LANG/controller/action respectively?

I would prefer to do it from Phalcon, if it can be done, and not from .htaccess.



39.3k
Accepted
answer

Have a look at this topic:

https://forum.phalcon.io/discussion/1527/multilingual-routing

The routing works the same way you want it to.

Alternatively, have a look at the website repo https://github.com/phalcon/website/. We implement full language routing there, which is exactly what you need.