I want to have a domain-specific robots.txt file, and still it works:
RewriteRule ^robots\.txt$ robots/%{HTTP_HOST}.txt [L]
But I would like to have a backup, so if the domain.txt file does not exist, go to default.txt
And this does not work, as it redirects all non-existent file names, plus I already have it! -f in another rule: RewriteCond% {REQUEST_FILENAME}! -f RewriteRule robots / default.txt [L]
So I need: Requests 1-catch robots.txt 2-Send robots /domain.txt if it exists 3-Else send robots / default.txt
source
share