I have two languages running on
http://anyscreensize.com:
English (
http://anyscreensize.com default)
Dutch (
http://anyscreensize.com/nl/)
Before I updated to MODX 2.2.0-RC3 all was fine (I used the MODX 2.2.0 Beta I think)
Now If I go to
http://anyscreensize.com I get redirected to
http://anyscreensize.com/nl/.
The only way to go to the main English page is to go to
http://anyscreensize.com/index and then the page loads fine.
How can it be that my default web context gets redirected to the dutch context?
Here my .htaccess (the space in http:// is to have it not render as a link...)
RewriteEngine On
RewriteBase /
# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^anyscreensize\.com [NC]
RewriteRule (.*) http ://anyscreensize.com/$1 [R=301,L]
# The Friendly URLs part
# detect language when requesting the root (/)
RewriteCond %{HTTP:Accept-Language} !^(nl) [NC]
RewriteRule ^$ nl/ [R=301,L]
# redirect all requests to /de/favicon.ico and /nl/favicon.ico
# to /favicon.ico
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(nl)/favicon.ico$ favicon.ico [L,QSA]
# redirect all requests to /de/assets* and /nl/assets* to /assets*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(nl)/assets(.*)$ assets$2 [L,QSA]
# redirect all other requests to /de/* and /nl/*
# to index.php and set the cultureKey parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(nl)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]
- Access controlls for web and dutch context are Load Only
The web context has the followings settings:
Here my gateway plugin (OnHandleRequest is checked):
<?php
//make sure the plugin does not run on the mgr context (the manager)
if ( $modx->context->get( 'key' ) != 'mgr') {
/**
* grab the current context from the request "c" parameter (or context_param_alias from system settings)
* the alternative .htaccess friendly URL rewrite rule must be activated
*/
$cntxt_param = $modx->getOption('context_param_alias', null, 'cultureKey');
if ( isset( $_REQUEST[$cntxt_param] ) && $_REQUEST[$cntxt_param] != '' ) {
switch ( $_REQUEST[$cntxt_param] ) {
case 'nl':
$modx->switchContext('nl');
break;
default:
// nothing because web is default
break;
}
}
}
There is nothing in the error log... Anybody know what's up?
[ed. note: ThaClown last edited this post 12 years, 3 months ago.]