Greetings to all gentlemen

There is such a thing robots.txt. There is a hell number of domains aimed at 1 hosting. Can I use redirection (.htaccess) on different robots.txt files for different hosting?

при домен1/robots.txt - папка1/robots.txt при домен2/robots.txt - папка35/robots.txt при домен3/robots.txt - папка999/robots.txt 

ps probably everything is up to me laugh, but I thought so (probably not right)

 RewriteCond http://site1.ru/robots.txt ^rew1/robots.txt [NC] RewriteCond http://site2.ru/robots.txt ^rew35/robots.txt [NC] RewriteCond http://site3.ru/robots.txt ^rew999/robots.txt [NC] 
  • it is possible, though it is not clear what exactly you want and what is the difficulty? - zb '
  • Send to a specific file, at a specific address, for short. Tell me how to write? - frank

1 answer 1

Do all domains specify the same directory? If yes, then:

 RewriteBase / RewriteCond %{HTTP_HOST} domain1.com$ #включая субдомены Rewriterule ^robots.txt$ dir1/robots.txt [L] RewriteCond %{HTTP_HOST} domain2.ru$ Rewriterule ^robots.txt$ dir2/robots.txt [L] 
  • Works. This is genius! - frank