Having .net framework handle .htm and .html files [modified]
-
So I tried adding .htm, .html, and even .* to the mapping configuration in IIS to aspnet_isapi.dll and have a httpHandler to handle .htm and .html files like this:
<httphandlers> <add type="Project.HttpHandlers.HtmExtensionHandler, Project.HttpHandlers" path="*.htm, *.html" verb="*"> </add> </httphandlers>
But when I type in something.html I get a 404 page from IIS (not .net), when I attach the debugger to the asp.net worker process it never goes into the http handler. Is there some reason why IIS won't give these requests to .net? I have also tried with my own made up extensions, but nothing. If I put a blank index.htm file in place and request index.htm then it goes through the handler as expected. I've also tried using an HttpModule to set up an event handler on BeginRequest to rewrite the path, but the HttpModule also never gets called if there is no place holder file.
Last modified: 16mins after originally posted --
-
So I tried adding .htm, .html, and even .* to the mapping configuration in IIS to aspnet_isapi.dll and have a httpHandler to handle .htm and .html files like this:
<httphandlers> <add type="Project.HttpHandlers.HtmExtensionHandler, Project.HttpHandlers" path="*.htm, *.html" verb="*"> </add> </httphandlers>
But when I type in something.html I get a 404 page from IIS (not .net), when I attach the debugger to the asp.net worker process it never goes into the http handler. Is there some reason why IIS won't give these requests to .net? I have also tried with my own made up extensions, but nothing. If I put a blank index.htm file in place and request index.htm then it goes through the handler as expected. I've also tried using an HttpModule to set up an event handler on BeginRequest to rewrite the path, but the HttpModule also never gets called if there is no place holder file.
Last modified: 16mins after originally posted --
-
So I tried adding .htm, .html, and even .* to the mapping configuration in IIS to aspnet_isapi.dll and have a httpHandler to handle .htm and .html files like this:
<httphandlers> <add type="Project.HttpHandlers.HtmExtensionHandler, Project.HttpHandlers" path="*.htm, *.html" verb="*"> </add> </httphandlers>
But when I type in something.html I get a 404 page from IIS (not .net), when I attach the debugger to the asp.net worker process it never goes into the http handler. Is there some reason why IIS won't give these requests to .net? I have also tried with my own made up extensions, but nothing. If I put a blank index.htm file in place and request index.htm then it goes through the handler as expected. I've also tried using an HttpModule to set up an event handler on BeginRequest to rewrite the path, but the HttpModule also never gets called if there is no place holder file.
Last modified: 16mins after originally posted --