We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16899
    • 284 Posts
    Hi Guys

    I´m using Babel to a multilingue website.

    I have two domains - domain1.co.uk and domain2.com - where domain1.co.uk it´s my main domain (default of my web context).
    My domain2.com it´s pointed to the same server of my domain1.co.uk and i´m routing each domain with the gateway plugin suggested for Babel´s instalation :

    <?php
    if($modx->context->get('key') != "mgr"){
        //grab the current domain from the http_host option
        switch ($modx->getOption('http_host')) {
            case 'www.domain2.com':
                //switch the context
                $modx->switchContext('de');
                //set the cultureKey
                $modx->setOption('cultureKey', 'de');
                break;
            default:
                // Set the default language/context here
                $modx->switchContext('web');
                $modx->setOption('cultureKey', 'en');
                break;
        }
    }
    


    The domain settings are:

    Context Settings for domain1.co.uk
    cultureKey - en
    site_url - http://www.domain1.co.uk/

    Access Permissions for domain1.co.uk
    Member - Load Only - 9999

    ------

    Context Settings for domain2.com
    cultureKey - de
    site_url - http://www.domain2.com/

    Access Permissions for domain2.com
    Member - Load Only - 9999

    I just followed the information describbed here - http://www.multilingual-modx.com/blog/2011/multilingual-websites-with-modx-and-babel.html - on official Babel´s site.

    But the problem is that the Babel plugin it´s not routing my domain2.com to the de context!!!What i´m doing wrong?

    Many thanks in advance
    Nuno
      • 16899
      • 284 Posts
      Any ideas?
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Does this routing plugin require .htaccess rewrite rules? Do you have those set up correctly?
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 16899
          • 284 Posts
          Quote from: sottwell at Aug 16, 2013, 07:19 AM
          Does this routing plugin require .htaccess rewrite rules? Do you have those set up correctly?

          In the documentation Babel´s author doesn´t make mention to any htaccess setup!!!
            • 38723
            • 165 Posts
            Quote from: legues at Aug 16, 2013, 07:47 AM
            Quote from: sottwell at Aug 16, 2013, 07:19 AM
            Does this routing plugin require .htaccess rewrite rules? Do you have those set up correctly?

            In the documentation Babel´s author doesn´t make mention to any htaccess setup!!!

            http://www.multilingual-modx.com/

            This might help you!
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I prefer to use the routing plugin from one of the comments on that page; it doesn't require any .htaccess rewrite rules.

              https://gist.github.com/gadamiak/3812853
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 16899
                • 284 Posts
                How do i work with this and Babel?
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  http://www.multilingual-modx.com/blog/2011/seo-friendly-multilingual-websites-with-modx-and-babel.html

                  The plugin I use is mentioned in a comment at the bottom; you simply install the plugin, set the system and context settings to suit your site's contexts and languages, and forget about fussing with the .htaccess file.

                  I wrote a router plugin, which handles subfolder setup without a need to modify url rewriting in the webserver. All routing is done in MODX itself. It handles client accepted languages.

                  You can get it from GitHub: https://gist.github.com/3812853

                  I'm going to publish a how-to in Babel docs on MODX wiki soon.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 16899
                    • 284 Posts
                    Ok, i tried all this stuff and it´s not working. Tell me something.... i did an A record to point my second domain to my hosting where i have my first domain working fine ! I´ve also change the name servers of my second domain to my hosting nameservers!! Is this ok? Am i missing something? is this enough to have babel working fine with 2 TLD ?

                    Regards
                      • 16899
                      • 284 Posts
                      Hi guys any ideas? I really need help on this!!! sad