I have a multilanguage and multidomain site. It runs through a unique CMS installation (Drupal), so I have a single root directory. So if I have a static robots.txt, there I only can show the files for a single domain, as far as I know.
Could I put a line in .htaccess
Redirect 301 /robots.txt /robots.php
(or equivalent instruction, and please, indicate which one if allowed)
so it redirects to a dynamic php file, where I can serve different contain according to the $_SERVER['HTTP_HOST']
?
And the same question for sitemap.xml, so I can serve a dynamic sitemap.php which indicates different links for each different domain.
The problem with no using .txt and .xml is, as mentioned, that all the domains share a single physical directory in the server computer.