Answer the question
In order to leave comments, you need to log in
How to "remember" the selected city on a site with cities on subdomains?
How to remember the choice of the city on the site, given that the cities are implemented as subdomains.
The task is to make regional subdomains for the site for seo site promotion in different cities according to geo-dependent queries.
At the moment, I have made robots and sitemap dynamically unique for each subdomain. Implemented city entry tokens so that for each city on its subdomain, a mention of the relevant city is displayed. Made a city selection menu.
I registered the *.domain.ru subdomain in the domain aliases, now when you specify a non-existent subdomain, for example spb.domain.ru, the contents of the domain.ru page with the mention of Peter are opened, that is, everything is fine. Same with the rest of the pages and cities.
BUT. I don’t know how to implement remembering the selected city, so that when you go from the spb.domain.ru page to the internal one, for example, to the /catalog section, stay within the selected subdomain, i.e. so that the address bar of the browser shows spb.domain.ru/catalog, and not domain.ru/catalog Tell me
in which direction to think. Cookies, .htaccess or something else. If possible with examples.
Answer the question
In order to leave comments, you need to log in
Build URL based on current domain/subdomain. Cookies and everything else is useless here.
assign to subdomain -> create url from subdomain+url
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question