Modx multilingual is not working

I am trying to add a multilingual system to my site. but when I try to visit the “bn” URL it redirects to the home URL.
Site URL: http://modx.maisto-design.de/

this is my context settings

here is my .htaccess file

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(en|bn)/favicon.ico$ favicon.ico [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(en|bn)/assets(.*)$ assets$2 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en|bn)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]

What extra (XRouting, LangRouter, etc.) do you use to switch the context?
Or do you use a custom plugin?

I have tried XRouting and custom plugins as well but none is working.
you can recommend one of them and write the .haccess file as needed.
Thanks in advance

Maybe try also adding the setting http_host to your context.


If you are using the extra XRouting or LangRouter then use the default RewriteRule in your .htaccess.

RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

For LangRouter follow the instructions in the documentation.


For a custom plugin (and the current RewriteRule in .htaccess) maybe try the code from this page:

<?php 
if($modx->context->get('key') != "mgr"){
    /* grab the current langauge from the cultureKey request var */
    switch ($_REQUEST['cultureKey']) {
        case 'bn':
            /* switch the context */
            $modx->switchContext('bn');
            break;
        default:
            /* Set the default context here */
            $modx->switchContext('web');
            break;
    }
    /* unset GET var to avoid
     * appending cultureKey=xy to URLs by other components */
    unset($_GET['cultureKey']);
}