This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Rewite for robots.txt by subdomain
Author
Message |
mrben
Newbie


Joined: 05 November 2008
Posts: 5
Posted: 31 August 2010 at 9:19am

Hi there,

I have an IIS6 hosted site using ISAPI_Rewrite 2.8 that contains a number of subdomains, all pointing to the same directory/ codebase on the server (different content is served based on the subdomain requested).

I'd like to add a unique robots.txt file for each subdomain (particularly so I can specify a different sitemap.xml for each one).  I've read the other posts on the subject here but nothing does quite what I am after.

My existing httpd.ini looks like this:
Code:

[ISAPI_Rewrite]

#OTHER DOMAINS - LIVE SERVER ONLY
RewriteCond  Host:  (www\.)?olddomain\.com
RewriteRule  (.*)   http://www.newdomain.com$2 [I,RP]
RewriteCond  Host:  newdomain\.com
RewriteRule  (.*)   http://www.newdomain.com$2 [I,RP]
RewriteCond  Host:  (www\.)?newdomain\.com
RewriteRule  (.*)   http://www.newdomain.com$2 [I,RP]

#EXCLUDES -- allow access to this directory
RewriteRule /(?:resources_app|scripts|rss)(?:/.*)? $0 [I,L]
RewriteRule /index.php / [I,R]

#Rule removes trailing slash, so site doesn't oops & forwards parameters
RewriteRule /([a-zA-Z=0-9_&//\-]*)/ /$1 [I,R]

RewriteRule ([^?]+)\?([a-zA-Z=0-9_&\-+%.]*) /index.php?page_url=$1&$2 [I,L]
RewriteRule .* /index.php?page_url=$0 [I,L]



Could I have a starter for 10 please?  Or a suggestion on a better approach?

Thanks

Ben
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 01 September 2010 at 3:34am

So, do you want something like when you request subdomain1.domain.com/robots.txt the content will be taken from www.domain.com/robots1.txt?
And similar scenario for other subdomains?
Please clarify how you want it to work on specific examples.


__________________
Regards,
Anton
Back to Top
 

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

Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum