Jako / LangRouter

Language context router for use with Babel in MODX Revolution
https://jako.github.io/LangRouter/
GNU General Public License v2.0
10 stars 4 forks source link

modx not in webroot #20

Open gyorgycsintalan opened 5 years ago

gyorgycsintalan commented 5 years ago

Greetings!

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!

muzzwood commented 1 year ago

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.

Jako commented 1 year ago

It was somehow a stupid decision to remove the cultureKey from the base_url during 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 commented 1 year ago

Yeah turns out the fix works fine. :tada: 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).