Mobile app version of vmapp.org
Login or Join
Kristi941

: 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

@Kristi941

Posted in: #Domains #RobotsTxt #UrlRewriting

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

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kristi941

1 Comments

Sorted by latest first Latest Oldest Best

 

@Frith620

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme