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.
You can create 3 files:
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
Thanks for your suggestion.