Is there a simple way to map /robots.txt to a HttpHandler using only the web.config? I’ve tried all sorts of changes to the httpHandlers tag but none have made any difference. All the examples require modifications to IIS site properties, which I cannot access.
Is there a way using only the web.config to map:
<add verb="*" path="/robots.txt" type="Site.RobotsHandler" />
correctly?
I’m currently using .NET 3.5 and MVC2.
Based off some of the comments on other answers I’m guessing you’re using iis6? As far as I know it’s not possible to alter iis6 handler mappings via web config. .txt files will never reach asp.net without changing default mappings.