Forums / Cotonti / Support / i18n rewrite question

Twiebie
#1 2012-09-24 00:08

I'm trying to setup i18n to use multiple languages on a website.
Most of the URL rewrite stuff works fine except for the index page.

The working URL's are like this: www.domain.com/subfolder/en/news/somepagetitlehere which is fine.

But when clicking on the index page (or on the language flag in the langselector on the index) it rewrites to this: www.domain.com/en/subfolder/index.php

I have the following in my .htaccess:

# Rewrite engine options
Options -Indexes
RewriteEngine On

# Server-relative path to Cotonti. Replace it with your path if you run Cotonti
# in a subfolder
RewriteBase "/subfolder"

# Language selector
RewriteRule ^(nl|en)/(.*) $2?l=$1 [QSA,NC,NE]

# Sitemap shortcut
RewriteRule ^sitemap\.xml$ index.php?r=sitemap [L]

# Admin area and message are special scripts
RewriteRule ^admin/([a-z0-9]+) admin.php?m=$1 [QSA,NC,NE,L]
RewriteRule ^(admin|login|message)(/|\?|$) $1.php [QSA,NC,NE,L]

# System category has priority over /system folder
RewriteRule ^system/?$  index.php?rwr=system [QSA,NC,NE,L]

# All the rest goes through standard rewrite gateway
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]+) index.php?rwr=$1 [QSA,NC,NE,L]
This post was edited by Twiebie (2012-09-24 01:32, 11 years ago)
Trustmaster
#2 2012-09-24 04:57

I use this in datas/urltrans.dat to fix that:

index	*	/{!$e}

 

May the Source be with you!
Twiebie
#3 2012-09-24 21:16

Hmm, that doesn't seem to change anything.

It's still rewriting the homepage to www.domain.com/en/subfolder/, instead of www.domain.com/subfolder/en/

Trustmaster
#4 2012-09-25 08:06

Indeed, got the same bug on my localhost.

May the Source be with you!
Twiebie
#5 2012-09-25 09:52

Is it because of the subfolder you reckon?

Trustmaster
#6 2012-09-25 14:47

Right

May the Source be with you!