MODX Revo多语言网站无法正常工作

时间:2014-03-28 12:27:29

标签: .htaccess multilingual modx modx-revolution

我正在尝试按照本文在MODX Revo中设置多语言网站

http://designfromwithin.com/blog-webdesign-development/2012/01/12/modx-multilingual-setting-up-babel-and-have-a-website-with-multible-languages/

索引页面工作正常,但当我切换到另一种语言时,我在Chrome中收到此消息:

此网页有重定向循环

任何想法如何解决这一问题? 这是我的.htaccess内容,也许出现了问题:

RewriteEngine On
RewriteBase /modxr/

# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
# RewriteCond %{HTTP_HOST} .
  RewriteCond %{HTTP_HOST} !^localhost/modxr [NC]
# RewriteRule (.*) http://localhost/modxr/$1 [R=301,L]
# The Friendly URLs part
# redirect all requests to /ru/favicon.ico
# to /favicon.ico
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(lv|ru)/favicon.ico$ favicon.ico [L,QSA]

# redirect all requests to /ru/assets* to /assets*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(lv|ru)/assets(.*)$ assets$2 [L,QSA]

# redirect all other requests to  /ru/*
# to index.php and set the cultureKey parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(lv|ru)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]

P.S。我在WAMP本地服务器上进行测试

1 个答案:

答案 0 :(得分:0)

首先,你有两行你忘了取消注释:

# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^localhost/modxr [NC]
RewriteRule (.*) http://localhost/modxr/$1 [R=301,L]

看看是否不会停止循环。