Hi guys,
yeah, yeah, yeah... it took me 5 days but I finally found a solution that worked for me... I tried it with two different webhosting companies (1&1, USA and UDmedia, Germany) but as I described above, I couldn't make it work on both servers. What worked for me was the following solution:
RewriteBase /subfolder/
This is what you told me...
RewriteCond %{QUERY_STRING} !mylang=[armenian|bosnian|brazilian|creole|croatian|danish|english|french|german|greek|indonesian|italian|japanese|latvian|lithuanian|persian|russian|serbian|spanish|srpski|turkish|vietnamese]{2,}
RewriteRule ^([hy]{2})/(.*)$ index.php?mylang=armenian [QSA]
RewriteRule ^([bs]{2})/(.*)$ index.php?mylang=bosnian [QSA]
# RewriteRule ^([pt\-BR]{5})/(.*)$ index.php?mylang=brazilian [QSA]
RewriteRule ^([ht]{2})/(.*)$ index.php?mylang=creole [QSA]
RewriteRule ^(
{2})/(.*)$ index.php?mylang=croatian [QSA]
RewriteRule ^([da]{2})/(.*)$ index.php?mylang=danish [QSA]
RewriteRule ^([en]{2})/(.*)$ index.php?mylang=english [QSA]
RewriteRule ^([fr]{2})/(.*)$ index.php?mylang=french [QSA]
RewriteRule ^([de]{2})/(.*)$ index.php?mylang=german [QSA]
RewriteRule ^([el]{2})/(.*)$ index.php?mylang=greek [QSA]
RewriteRule ^([id]{2})/(.*)$ index.php?mylang=indonesian [QSA]
RewriteRule ^([it]{2})/(.*)$ index.php?mylang=italian [QSA]
RewriteRule ^([ja]{2})/(.*)$ index.php?mylang=japanese [QSA]
RewriteRule ^([lv]{2})/(.*)$ index.php?mylang=latvian [QSA]
RewriteRule ^([lt]{2})/(.*)$ index.php?mylang=lithuanian [QSA]
RewriteRule ^([fa]{2})/(.*)$ index.php?mylang=persian [QSA]
RewriteRule ^([ru]{2})/(.*)$ index.php?mylang=russian [QSA]
RewriteRule ^([sr]{2})/(.*)$ index.php?mylang=serbian [QSA]
RewriteRule ^([es]{2})/(.*)$ index.php?mylang=spanish [QSA]
# RewriteRule ^([sr\-Cyr]{6})/(.*)$ index.php?mylang=srpski [QSA]
RewriteRule ^({2})/(.*)$ index.php?mylang=turkish [QSA]
RewriteRule ^([vi]{2})/(.*)$ index.php?mylang=vietnamese [QSA]
I had to comment out the two red lines (@datahell: I don't know why, but they were producing the internal server error you have seen on my installation) - to make the language switch work correctly I also had to remove the opening slash of the rewrite-rule URL of each language I used, so:
RewriteRule ^([en]{2})/(.*)$ index.php?mylang=english [QSA]
instead of
RewriteRule ^([en]{2})/(.*)$ /index.php?mylang=english [QSA]
I don't know if all those problems are due to a miss-configuration of both of my webhosters, but I thought it might help people having the same problem on hosted webspace.
Cheers,
Chris