HttpHandler wildcard does not handle static files

I looked through some of the old questions but can't find anything.

I have a HttpHandler wildcard in my web application that processes the url and works if it can do anything with it

If it cannot, then the StaticFile handler should pick it up and just serve it as a static file (for example, an html file).

The problem is that it goes through the Wildcard handler and then does not seem to go to the StaticFileHander. Is there something I need to do for the Wildcard handler or in the web configuration?

This is my web.config:

<add name="Wildcard" path="*" verb="*" type="Rewriter.RewriterHttpModule" modules="IsapiModule" requireAccess="None" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" /> <add name="StaticFile" path="*.*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="File" requireAccess="Read" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" /> 
+6
web-config
source share
3 answers

Perhaps your HttpHandler should explicitly disable the request to the StaticFileHandler.

+3
source

To keep track of what Hunter said, yes, maybe add this entry to your Web.Config after the first wildcard match:

 <add verb="*" path="*" type="System.Web.StaticFileHandler" /> 

Just a thought. Did not test this or anything else.

+3
source

Check the application pool pipeline mode. If it is classic, you need to configure handlers in the <httpHandlers> section. If it is integrated, you should use the <handlers> section in web.config.

+2
source

All Articles