first i followed the instructions to multi language setup here:
http://www.multilingual-modx.com/blog/2011/seo-friendly-multilingual-websites-with-modx-and-babel.html
then i pointed two domains to the same httpdocs directory, changed the index:
/* setup for multiple domains */
switch(strtolower(MODX_HTTP_HOST)) {
case 'www.1.eu':
// if the http_host is modx-templates.com, switch the context to web
$modx->initialize('web');
break;
case 'www.2.eu':
// if the http_host is modx-templates.com, switch the context to web
$modx->initialize('2-de');
break;
default:
// by default / if no other rule can be applied, load 'web' context
$modx->initialize('web');
break;
}
This seems being ignored, overwritten by the gateway plugin. The gateway plugin modification is in my previous post.
the context settings for X
http_host: www.x.eu/de/ or www.x.eu/en/
site_url: http://www.x.eu/de/ or http://www.x.eu/en/
base_url: /de/ or /en/
cultureKey: de or en
site_start: resp. ID
error_page: resp. ID
site_name: wse
i still have problems with is the site_status of www.2.eu. if i switch it off i can't use preview. the site stays locked. also i did not use separate directories for config.ore.php, htaccess and index.php. btw my htaccess:
RewriteEngine On
RewriteBase /
# FORCE WWW ON ALL URLs
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# The Friendly URLs part
# detect language when requesting the root (/)
RewriteCond %{HTTP:Accept-Language} !^de [NC]
RewriteRule ^$ de/ [R=301,L]
# redirect all requests to /en/assets* and /de/assets* to /assets*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(de|en)/assets(.*)$ assets$2 [L,QSA]
# redirect all requests to /en/1* and /de/1* to /1*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(de|en)/1(.*)$ etalon$2 [L,QSA]
# redirect all requests to /en/2* and /de/2* to /2*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(de|en)/2(.*)$ 2$2 [L,QSA]
# redirect all other requests to /en/* and /de/*
# to index.php and set the cultureKey parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(de|en)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]
This setup seems to be proofed for two domains each with en and de. more has to be shown
[ed. note: charismeki last edited this post 11 years, 3 months ago.]