Answer the question
In order to leave comments, you need to log in
How to redirect to subdomains correctly?
I am developing an online store, I need to make redirects from the main domain to subdomains depending on the geo. Okay, how I imagine it:
In order not to bother, now let's look at an example of how to redirect from one domain to one subdomain. Make a 302 redirect on the main domain:
RewriteEngine On
RewriteCond %{HTTP_HOST} my.site
RewriteRule (.*) https://1.my.site/$1 [R=302,L]
User-agent: *
Host: my.site
Disallow: *
User-agent: *
Host: my.site
Sitemap: http://1.my.site/sitemap.xml
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question