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 ^rew1/robots.txt [NC] RewriteCond ^rew35/robots.txt [NC] RewriteCond ^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}$ #включая субдомены Rewriterule ^robots.txt$ dir1/robots.txt [L] RewriteCond %{HTTP_HOST}$ Rewriterule ^robots.txt$ dir2/robots.txt [L] 
  • Works. This is genius! - frank