We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Quote from: Fairytree at Nov 25, 2010, 09:24 AM

    Quote from: OpenGeek at Nov 25, 2010, 09:06 AM

    Look at the URL that is being generated; instead of doing the redirect, just output it. What does it return?
    The generated URL is the URL of the parent document. For example: http://example.com/fr/test/ ("test" is the alias of the parent document).
    Is it absolute is my point, i.e. includes the scheme and hostname, not just a URI? Otherwise, it’s gotta be some conflict in your site definition, or the way you have context handling setup, as I cannot reproduce this.
      • 34001
      • 428 Posts
      OK, I’ve just added the snippet on another page and it does the return the correct URL:
      http://example.com/fr/test/child.html

      So, I have to find what’s wrong with my setup...
        Intégrateur web freelance
        • 34001
        • 428 Posts
        Just for the information, if I remove the site_url setting from the context, the redirection is working.
        But of course, without this setting, I no longer have the fr alias in the URL... So this is not what I’m after.
          Intégrateur web freelance
          • 17723
          • 221 Posts
          Hi Firytree,
          How did You managed to display images and load css, js files with this plugin soulution?
          In my case this solution brakes the webpage since base href is mydomain.com/EN/ and all links relate to this base url.
          luke
            Lucas from AroundCyprus.net
            • 25910
            • 26 Posts
            Hi,

            I faced more or less the same problem. I had a base href like this in my template:

            <base href="www.mysite.com" />

            I added a http:// like this:

            <base href="http://www.mysite.com" />

            and it was ok. Hope this can help...
              • 22303 MODX Staff
              • 10,725 Posts
              Why aren’t you using
              <base href="[[!++site_url]]">
              ?
                • 16402 ☆ A M B ☆
                • 33 Posts
                The solution in this thread has been a brilliant and elegant solution for a multi-language site I’m working on. But I did have the same problem when trying to display a container page. In my testing, the problem resulted because the trailing slash was getting stripped off by the plugin when it needed to be there for container pages.

                My solution was simple, and it seems to work without any side effects to the solution given. Remove the second argument from "trim" - so change the line:

                $pieces = explode(’/’, trim($_REQUEST[$modx->getOption(’request_param_alias’, null, ’q’)], ’/’), 2);

                To:

                $pieces = explode(’/’, trim($_REQUEST[$modx->getOption(’request_param_alias’, null, ’q’)]), 2);

                  Paul Kabotie, Software Engineer & MODX Ambassador
                  Rocky Mountain Region - Denver, CO
                  Linkedin: http://www.linkedin.com/pub/paul-kabotie/b/a24/208/

                  Attend one of our meetups! http://www.meetup.com/modx-denver/
                  Join us on Facebook: http://www.facebook.com/pages/Rocking-MODX-in-Denver/152662201549963
                  • 34009
                  • 5 Posts
                  Hello
                  FistChildRedirect did not work for me in a other context than the default 'web' when using context for different domains.
                  I had to change line 77 in the Snippet:
                  return $modx->sendRedirect($url);
                  to
                  return $modx->sendRedirect($modx->config['site_url'].$url);
                  then it worked.
                  Note:
                  (I did set site_url in the context settings)
                  Perhaps this helps someone.
                  Kind regards, Hanna