mercredi 29 avril 2015

MODX Revolution and Babel not working with .htaccess

I have been trying to figure out how to set up multilingual site with MODx and Babel. I'm pretty sure the contexts and the plugin are both set correctly but the .htaccess is probably causing me troubles. Here's what is looks like, I have the root set in a subfolder /test/voltage/admin2test and only one extra language (besides English) in /test/voltage/admin2test/cz/

RewriteEngine On
RewriteBase /test/voltage/admin2test/
# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} !^my-domain\.cz [NC]
#RewriteRule (.*) http://my-domain.cz/$1 [R=301,L]
#
# or for the opposite domain.com -> www.domain.com use the following
# DO NOT USE BOTH
#
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} !^www\.my-domain\.cz [NC]
#RewriteRule (.*) http://ift.tt/1Fyn1QA [R=301,L]
# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
# https://www.domain.com when your cert only allows http://ift.tt/1keluBG
#RewriteCond %{SERVER_PORT} !^443
#RewriteRule (.*) http://ift.tt/1jmvRYG [R=301,L]
# The Friendly URLs part
# detect language when requesting the root (/)
#RewriteCond %{HTTP:Accept-Language} !^en [NC]
#RewriteRule ^$ en/ [R=301,L]
#RewriteRule ^$ cz/ [R=301,L]

# redirect all requests to /cz/favicon.ico
# to /favicon.ico
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(cz)/favicon.ico$ favicon.ico [L,QSA]

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

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

Aucun commentaire:

Enregistrer un commentaire