Using an url parameter for language
This is an open discussion with 3 replies, filed under General.
Search
Using a htaccess file is probably the easiest thing to do. You should rewrite www.domain.com/lang/page to www.domain.com/page/lang.
Then you should filter the datasource on the url parameter, and put the lang in all links using xslt.
Sounds like a lot of work, though..
I started to write the Language Redirect extension that allows you to do exactly what you want. I’m using it at two sites I’m developing at the moment but it’s still in beta. The extension adds a rule like
RewriteRule ^(en|pt|es)-?(gb|us)?/(.*/?)$ index.php?language=$1®ion=$2&symphony-page=$3&%{QUERY_STRING} [L]
to the .htaccess
file, so you can use the $url-language
and $url-region
parameters to filter your datasources. The extension also saves the current parameters in a cookie and adds those to the parameter pool for dynamic language links.
Thanks (a little bit late) a lot!
Create an account or sign in to comment.
Hi guys!
I’m developing an multi-lang website and I’d like to know how the best way to send and keep an url parameter with the active language. Ex:
Can anyone has an idea of how I can use this parameter?
Note: The section has a specific field for the language (using the extension Language Field).
Thanks a lot!