ModX无法切换上下文

时间:2015-10-14 21:47:50

标签: modx modx-evolution

我有一个网站需要翻译成三种外语。我通过系统创建了一个新的上下文 - >上下文,然后为base_url,site_url和http_host创建上下文设置。但是,当我在新上下文中转到主页时,它会从初始上下文路由到File Not Found资源。我有什么想法可能会丢失/做错了吗?

谢谢

编辑:以下是我的.htaccess文件中未注释的行

RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

(a lot of rewrite rules from an older version of the site that used .aspx files. None of them match with the URLs on the website)

# Add 'www' to the HTTP_HOST for all domains except seasidehotelshawaii.com
# this will also preserve the query string.
RewriteCond %{HTTP_HOST} !^(.*)[this_is_the_main_domain].com$
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

我对.htaccess文件了解不多,但这就是其中的内容。 this_is_the_main_domain.com是三个子站点的父级。我正在尝试为每个子站点创建三个上下文。

2 个答案:

答案 0 :(得分:0)

您必须对htaccess文件进行一些非常广泛的更改。我猜你没有写一个上下文欺骗插件?

请遵循以下教程:

http://www.multilingual-modx.com/blog/2011/multilingual-websites-with-modx-and-babel.html

http://www.multilingual-modx.com/blog/2011/seo-friendly-multilingual-websites-with-modx-and-babel.html

基本上,你还没有给modx一个改变上下文的方法,或者给它一个正确生成你的url的方法。

答案 1 :(得分:0)

尝试使用XRoutingContextRouter插件将您的域路由到正确的上下文。

相关问题