C
C
Copylefter2016-02-24 16:26:31
Internationalization and localization
Copylefter, 2016-02-24 16:26:31

How to give the user the option to select a language after a forced htaccess redirect?

There is a simple multilingual site, almost a one-page site. The site has 3 language versions. By default, the root is English, while the Russian and German versions lie on the ru and de subdomains, respectively. htaccess has a redirect depending on the browser language.

RewriteCond %{HTTP:Accept-Language} ^ru [NC]
RewriteRule ^$ http://ru.sitename.com/ [L,R=301]

If a user with a Russian-language browser visits the sitename.com root, he is redirected to the ru.sitename.com subdomain. At the same time, if he selects English in the language switcher, that is, the root, he will still be transferred to the Russian subdomain.
How to enable the user to switch to a language other than the language of his browser?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2016-02-24
@By_Engine

Set cookies for the language. If there are no cookies - default, otherwise throw on the version that is written in the cookie

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question