This is my second try of MODX (first one was some years ago and I’ve forgot everything related to it) so my troubles will probably seem childish… Sorry. Really want to keep this CMS my default one for making simple web sites.
I build 2-language website: default is Russian, and the second language is English. My web server is Nginx.
I Installed both Babel and LangRouter and followed their respective instructions which seem sane. Babel gives me the ability to interlink corresponging pages, and LangRouter the ability to hit a page based on the language of my choice. For LangRouter, I followed this manual: Usage - LangRouter . Friendly URLs are off now.
Now I have 2 Contexts, “web” being the default one (Russian) and “en” (English).
Seems like I have a problem with LangRouter which interfere with URIs from the client.
Home page / works well and I get it fine:
There, I have a link to some other page, say [[~2]], which ultimately gives me this URL:
And this URL gives me 404 generated by MODX (not Nginx). On the othe hand, this changed URL gives me what I request:
Note the absence of cultureKey in it.
I tried to debug it in the LangRouter code and it brought me some understanding of what it does under the hood, but still I can’t get it working. I think I miss something obvious here.
My understangind is this: LangRouter determines the desired language by parsing Request URI. If it finds cultureKey there, it uses it like that: if the current Context is of that same language it cuts cultureKey out of REQUEST_URI, otherwise it switches to that target Context and cuts cultureKey too. And if cultureKey isn’t found it determines it from Accept-Language client header and switches to that Context without tampering REQUEST_URI.
But despite cutting cultureKey from REQUEST_URI the final URI still contains it so it results in 404.
Can anyone suggest a solution or present their configs for a similar setup: MODX+Nginx+Multilingual?