Answer the question
In order to leave comments, you need to log in
How to change the language on the site through a subdomain?
Hello!
The site uses 2 languages, Russian and English. Changing the language is done by adding ?lang={language} to the link.
<a href="?lang=russian">Русский язык</a>
<a href="?lang=english">Английский язык</a>
Answer the question
In order to leave comments, you need to log in
Well, when you click on site.ru/videos?lang=english, write in cookies that the user has English.
And when accessing the site, read the cookies and redirect to en.site.ru/videos if the cookies contain English.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question