This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Redirects based on specific domains
Message |

Joined: 29 May 2009
Posts: 3
Posted: 24 October 2011 at 3:07pm

I have 8 websites running on a single server off of a single folder/codeset. I need to figure out a way to redirect robots.txt and sitemap.xml requests to domain1-robots.txt and domain8-robots.txt based on the actual domain name. I have been trying various rewrite conditions and rules and haven't been able to make it stick. I am using the Free version of Isapi rewrite 3.

Basically I need to accomplish this:

If domain is then 301 redirect robots.txt to test-robots.txt
If domain is then 301 redirect robots.txt to park-robots.txt

Any ideas? Thanks
Back to Top
Admin Group

Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 25 October 2011 at 1:50am

Please try the following ruleset in httpd.conf:

RewriteCond %{HTTP_HOST} ^(?:www\.)?$ [NC]
RewriteRule ^/robots\.txt$ /test-robots.txt [NC,R=301,L]

RewriteCond %{HTTP_HOST} ^(?:www\.)?$ [NC]
RewriteRule ^/robots\.txt$ /park-robots.txt [NC,R=301,L]

Back to Top

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version