V
V
Vadim Timoshenko2018-11-10 15:28:43
Search Engine Optimization
Vadim Timoshenko, 2018-11-10 15:28:43

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

1 answer(s)
D
Dmitry, 2018-11-10
@slo_nik

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 question

Ask a Question

731 491 924 answers to any question