: Different robots.txt for two different domains point to same folder I have the following two domains: domain.com test.domain.com Both point to same folder which is "public_html". What
I have the following two domains:
domain.com
test.domain.com
Both point to same folder which is "public_html". What I want is a different robots.txt file for each domain. So when someone browse domain.com/robots.txt then a different file is shown. And when someone go to test.domain.com/robots.txt then a different file is shown. How can I do this using URL rewriting in .htacces?
Thanks
More posts by @Kristi941
1 Comments
Sorted by latest first Latest Oldest Best
Remeber that no one from internet can see your directory tree, so stackoverflow.com/ and test.stackoverflow.com are completely diffrent sites for us and search robots.
You can do that by checing http host in query.
RewriteCond %{HTTP_HOST} ^test
RewriteRule robots.txt someotherrobots.txt
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.