0

I have IIS 7.5 with ISAPI_Rewrite(Helicon)

I'm trying to do so that the robots.txt from each hosted site will be the same.

For that purpose I have one dummy site(sometestsite.com) which has robots1.txt(which I want to be reused on each other site)

And I have following RewriteRule:

RewriteRule ^(.*)/robots.txt$ http://sometestsite.com/robots1.txt

When I am requesting http://sometestsite.com/robots.txt it displays contents of http://sometestsite.com/robots1.txt as expected, but when I am requesting http://completelydifferentsite.com/robots.txt it redirects me to http://sometestsite.com/robots1.txt.

What I am doing wrong? Also if here is another approach to achieve my goal I will be very thankful to hear one.

Vladimirs
  • 8,232
  • 4
  • 43
  • 79
  • Where do you have this rule? .htacess? – Andrew May 27 '13 at 12:54
  • This rule is in httpd.conf in ISAPI_Rewrite folder and this rule applied to all hosted sites. – Vladimirs May 27 '13 at 14:56
  • Than all you need: RewriteCond %{HTTP:Host} ^(.*) [NC] RewriteRule ^(.*)/robots.txt$ http://%1/robots1.txt – Andrew May 27 '13 at 18:35
  • Thank you for your answer, but unfortunately it doesn't solve my problem because I don't want to have robots.txt and robots1.txt on each site. I want to have only one file robots1.txt hosted on site A and when requested robots.txt of each site (A,B,C..) it should provide contents of A/robots1.txt. So in my example when I requesting A/robots.txt I have url A/robots.txt with contents of A/robots1.txt, but when I requesting B/robots.txt it redirects me to A/robots1.txt, but I am expect have URL B/robots.txt with content of A/robots1.txt. – Vladimirs Jun 05 '13 at 14:57

0 Answers0