Git Product home page Git Product logo

Comments (5)

mikrobi avatar mikrobi commented on August 27, 2024

Please note that Babel itself doesn't perform any redirects. Currently there is no gateway plugin shipped with Babel. How does your gateway plugin look like? Are you using any htaccess redirects?

from babel.

jmbuytaert avatar jmbuytaert commented on August 27, 2024
if (stripos($_SERVER['REQUEST_URI'],'/fr') !== false || stripos($_SERVER['REQUEST_URI'],'/fr/') !== false) {
    $modx->switchContext('french');
    $modx->setOption('cultureKey', 'fr');

} elseif (stripos($_SERVER['REQUEST_URI'],'/de') !== false || stripos($_SERVER['REQUEST_URI'],'/de/') !== false) {
    $modx->switchContext('german');
    $modx->setOption('cultureKey', 'de');

} else {
    $modx->switchContext('web');
    $modx->setOption('cultureKey', 'en');
}

from babel.

mikrobi avatar mikrobi commented on August 27, 2024

Here we go, the unwanted behaviour is caused by your own gateway plugin. This statement validates to true for something like /demand.html

 stripos($_SERVER['REQUEST_URI'],'/de') !== false

Check out the offical Babel tutorials at http://www.multilingual-modx.com/ to get your context switches work properly.

from babel.

jmbuytaert avatar jmbuytaert commented on August 27, 2024

That was what was wrong! Thank you! But I want people to be redirected to
the german context wether they type in site.com/de/ or site.com/de (with or
without the trailing slash... is that something that I need to add in the
htacess file?

On Wed, Dec 21, 2011 at 2:38 AM, Jakob Class <
[email protected]

wrote:

Here we go, the unwanted behaviour is caused by your own gateway plugin.
This statement validates to true for something like /demand.html
stripos($_SERVER['REQUEST_URI'],'/de') !== false

Check out the offical Babel tutorials at http://www.multilingual-modx.com/to get your context switches work properly.


Reply to this email directly or view it on GitHub:
#48 (comment)

Best Regards,

Jean-Marc Buytaert
[email protected]
http://www.webdziner.com
832.886.8187

from babel.

mikrobi avatar mikrobi commented on August 27, 2024

Yes, I think so. Take a look at this tutorial for some htaccess rules: http://www.multilingual-modx.com/blog/2011/seo-friendly-multilingual-websites-with-modx-and-babel.html

from babel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.