Skip to content

modx not in webroot #20

Open
Open

Description

@gyorgycsintalan

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!

Activity

  1. muzzwood commented on Oct 27, 2023

    @muzzwood

    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.

  2. Jako commented on Nov 2, 2023

    @Jako
    Owner

    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.

  3. muzzwood commented on Nov 10, 2023

    @muzzwood

    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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions