There is a duplicate English version of the site. The site is written in php. The Russian version is in the root, the English version is in the / en folder. The language used in the cookie is stored. I want to write a script that would automatically pull up the desired php file of the English or Russian version depending on this cookie. Cook changes js when you click a switch. And I would also like that when referring to the main page of the English version, the url was just
site.com/en/
Now when accessing this url, the site redirects to the main page at the root (ie the Russian version), now the main page of the English version can only be accessed
site.com/en/index