Answer the question
In order to leave comments, you need to log in
How to replace robots.txt for regional subdomains?
Set up the site for subdomains region.sitename.ru.
But robots.txt is the same for everyone. And also sitemap.xml contains links to sitename.ru
How to solve this problem? How to issue your own robots.txt for each region?
Answer the question
In order to leave comments, you need to log in
Good afternoon.
Create your own robots.txt for each subdomain.
Use .htaccess
RewriteBase /
RewriteCond %{HTTP_HOST} site\.ru$
RewriteRule ^robots.txt/$ site_robots/robots.txt [L]
RewriteCond %{HTTP_HOST} site2\.ru$
RewriteRule ^robots.txt/$ site2_robots/robots.txt [L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question