Hello everybody,
I configured my site with this method but in my case I’ve have to use it a little bit different.
I changed my Javascript into:
function switchLanguage(lang) {
u = location.href.split('/');
for(var x in u){
if(x == 3){
if(lang == "en"){
u[2] += "/en";
}
else if(lang == "nl"){
u.splice(x,1);
}
}
}
[removed].href = u.join('/');
}A little bet explination about this:
When the preferred language is “nl” (Dutch) the site must be parsed like this: http://www.testsite.be/testweblog/testdetail/
When the preferred language is “en” (English) the site must be parsed like this:
http://www.testsite.be/en/testweblog/testdetail/
The code above works fine…
Such as every user I also want to remove the index.php from the URL
My .htaccess at root:
### MAIN DEFAULTS ###
Options +ExecCGI -Indexes
DirectoryIndex default.htm
#index.html index.htm index.php
DefaultLanguage en-US
AddDefaultCharset UTF-8
ServerSignature Off
### REWRITE DEFAULTS ###
RewriteEngine On
RewriteBase /
#Handle removal of index.php from EE URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(images|img|flash|css|js|files|lang|tinymce|themes|disclaimer|uploads|downloads|fav\.ico|robots\.txt|default.htm|sitemap\.xml) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]My .htaccess in directory “en”:
### MAIN DEFAULTS ###
Options +ExecCGI -Indexes
DirectoryIndex default.htm
#index.html index.htm index.php
DefaultLanguage en-US
AddDefaultCharset UTF-8
ServerSignature Off
### REWRITE DEFAULTS ###
RewriteEngine On
RewriteBase /
#Handle removal of index.php from EE URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(images|img|flash|css|js|files|lang|tinymce|themes|disclaimer|uploads|downloads|fav\.ico|robots\.txt|default.htm|sitemap\.xml) [NC]
RewriteRule ^(.*)$ /en/index.php/$1 [L]
Now the problem:
http://www.testsite.be/ - work fine
http://www.testsite.be/testweblog - works fine
http://www.testsite.be/en/index.php - works fine
http://www.testsite.be/en/ - DOESN’T work
http://www.testsite.be/en/site/ - DOESN’T work
http://www.testsite.be/en/site/index.php - DOESN’T work
Somebody an idea?!
The .htaccess seems to work on other, not multilanguage sites.
Thanks on beyond!
Greetings
Jonas