Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I18N language in URL index page problem
#3
yurifanboy Wrote:Nope just an issue with your .htacess rewrite rules I think ...
Very thank you yurifanboy, I'm to bad in RewriteCode to do something like this by myself. Both of your solutions work for me, however I qouted out the "redirect to language of your choice" because it is an unwanted behaviour and use now the first one:
Code:
# RewriteRule ^/?$ de/ [R,L]   # redirect to language of your choice. Quote out if undesired.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en|de|it)/(.*?/)?([A-Za-z0-9_-]+)/?$ index.php?id=$3&lang=$1 [QSA,L]
RewriteRule ^(en|de|it)/?$ index.php?lang=$1 [QSA,L]   # handle index page without 'index'
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]

What's even better: if you enter a URL without language code, it shows the browsers best fitting language. So you can use this perfectly in Signatures, letters, etc. for multilanguage users: for example "mydomain.info/vacations/" shows the page normally under ".../de/vacations/" or ".../it/vacations/" or ".../en/vacations/" in my case. When the user clicks on the navigation menu it continues in the chosen language. Very nice.
So I have to rethink about my wish to build different (freely) URLs for every language. Every solution has advantages and disadvantages (see my post under "Support for multilanguage sites, Internationalization (I18N)").
Advanced HTML5 & CSS3 coder. Simple JS & PHP hacker (not enough for new function coding). Build one webpage with GS (late 2012). Focusing on Theme customizing/Template files. Experience with WP.
Reply


Messages In This Thread
I18N language in URL index page problem - by ChriS - 2012-01-19, 20:43:13



Users browsing this thread: 1 Guest(s)