You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to know how to configure LangRouter if MODX is installed to a subfolder on the webserver (for example: /modx/ ) ? I tried setting the context url settings (set base_url to /modx/) and also to modify RewriteBase to /modx2/ in .htaccess but it doesn't work. What can I do in this case? Thank you!
This appears to be an issue with LangRouter that I just came across too. (Works perfectly when not in a subdirectory of course)
It actually does work for any resource that is not the site_start resource. When trying to load the resource set to site_start it loops endlessly and times out.
It can be fixed by adding the cultureKey to the base_url and removing it from the site_url.
For example the old base_url was /modx/ and I changed that to /modx/en/
The old site_url was {url_scheme}{http_host}{base_url}{cultureKey}/ and I changed that to {url_scheme}{http_host}{base_url}.
This is not a proper solution though as other functionality requires the base_url to not include the cultureKey (such as getting image urls) .
@Jako I had a go at fixing it, but no luck thus far.
Yeah turns out the fix works fine. 🎉 I just needed to add /modx/ to the phpthumbof.cache_url setting. Otherwise it would generate image urls with the cultureKey (since it uses the base_url as default).
Activity
muzzwood commentedon Oct 27, 2023
This appears to be an issue with LangRouter that I just came across too. (Works perfectly when not in a subdirectory of course)
It actually does work for any resource that is not the
site_startresource. When trying to load the resource set tosite_startit loops endlessly and times out.It can be fixed by adding the
cultureKeyto thebase_urland removing it from thesite_url.For example the old
base_urlwas/modx/and I changed that to/modx/en/The old
site_urlwas{url_scheme}{http_host}{base_url}{cultureKey}/and I changed that to{url_scheme}{http_host}{base_url}.This is not a proper solution though as other functionality requires the
base_urlto not include thecultureKey(such as getting image urls) .@Jako I had a go at fixing it, but no luck thus far.
Jako commentedon Nov 2, 2023
It was somehow a stupid decision to remove the
cultureKeyfrom thebase_urlduring creating that extra.SmartRouting and xRouting work the same and include the cultureKey in the baseUrl. I have to add that solution to the documentation.
muzzwood commentedon Nov 10, 2023
Yeah turns out the fix works fine. 🎉 I just needed to add
/modx/to thephpthumbof.cache_urlsetting. Otherwise it would generate image urls with the cultureKey (since it uses the base_url as default).