P
P
pink2floyd2018-08-26 09:46:33
MODX
pink2floyd, 2018-08-26 09:46:33

How to fix bad .htaccess babel plugin setting issue in modx?

Hello. The problem is that modx opens the Russian version and all its articles, but in English it only opens the main one

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Kuznetsov, 2018-08-27
@pink2floyd

What error comes up when you open the English version of the article?
CNC enabled or not?
Plugin installed on OnHandleRequest?
The plugin should be something like this:

<?php
if($modx->context->get('key') != "mgr")
{
    /* grab the current langauge from the cultureKey request var */
    $currCultureFromRequest = isset($_REQUEST['cultureKey']) ? $_REQUEST['cultureKey'] : NULL;
    $modx->log(modX::LOG_LEVEL_DEBUG, 'pageRouting: Income context key ' . $currCultureFromRequest);
    switch ($currCultureFromRequest) 
    {
        case 'ru':
        case 'en':
            /* switch the context */
            $modx->switchContext($currCultureFromRequest);
            $modx->log(modX::LOG_LEVEL_DEBUG, 'pageRouting: Context switched to ' . $currCultureFromRequest);
            break;
        default:
            /* Set the default context here */
            $modx->switchContext('web');
            $modx->log(modX::LOG_LEVEL_DEBUG, 'pageRouting: Context switched to web');
            break;
    }
    unset($_REQUEST['cultureKey']);        
}

.htaccessfor him this is (with reservations, the paths depend on you):
RewriteEngine On
RewriteBase /

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

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(web|en|ru)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]
# остальные Ваши настройки/директивы для apache/php

Again, contexts, settings, and so on must be set.
The official link where all this is described is www.multilingual-modx.com/blog/2011/seo-friendly-m...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question