domain-specific robots file with htaccess rewrite robots.txt to example.com.txt or fallback to default.txt
snippet in htaccess

domain-specific robots file with htaccess rewrite robots.txt to example.com.txt or fallback to default.txt

user8591

RewriteCond %{DOCUMENT_ROOT}/robots/%{HTTP_HOST}.txt -f
RewriteRule ^robots\.txt$ robots/%{HTTP_HOST}.txt [L]

RewriteRule ^robots\.txt$ robots/domain.txt [L]