London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
You can create 3 files:
robotsDomain1.txt
robotsDomain2.txt
robotsDomain3.txt
and then define your own handler, assign it to robots.txt in web.config
<httpHandlers>
<add verb="*" path="robots.txt" type="Project.RobotsHandler"/>
</httpHandlers>
and inside the handler check Request.Url.DnsSafeHost and return the content of one of the files. If you use IIS7 you define handlers in section
<system.webServer>
<handlers>
<add name="robots" path="robots.txt" verb="*" type="Project.RobotsHandler, Project" />
</handlers>
</system.webServer>
Thanks for your reply.
Can you point me to any URL that explains the code to be written in the Handler.
Thanks Maras. Below link is also usefull
http://www.atlasbay.com/2008/11/06/robotstxt-httphandler-in-iis7/
Thanks for your suggestion.
Hi All,
I have a EPi server web application. The same web application is hosted under 3 domains. Now my requirement is to have diffrenet Robots.txt for different domains. But since all the domains are pointing to sane folder I can have only file placed in that folder. Is there any workaround for placing seperate Robots.txt file under each domain.
Thanks in Advance.