Paul
Paul

Reputation: 9541

Wildcard HttpHandler not handling Static Files

I had a look through some of the older questions, but I can't find anything.

I have a Wildcard HttpHandler on my web app which is processing the url and working out if it can do anything with it

If it can't, then the StaticFile Handler should pick it up and just serve it as a static file (like an html file).

The problem is, it's going through the Wildcard handler, then seemingly not going to the StaticFileHander. Is there something I need to do to the Wildcard handler, or in the web config?

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" />

Upvotes: 6

Views: 3849

Answers (3)

Branislav Abadjimarinov
Branislav Abadjimarinov

Reputation: 5131

Check the application pool pipeline mode. If it is Classic than you have to configure your handlers in the <httpHandlers> section. If it is Integrated you should use the <handlers> section in web.config.

Upvotes: 2

alex
alex

Reputation: 953

To follow up on what Hunter said, yes, perhaps add this entry to your Web.Config following the first wildcard mapping:

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

Just a thought. Haven't tested this or anything.

Upvotes: 3

hunter
hunter

Reputation: 63522

Perhaps your HttpHandler should pass off the request to the StaticFileHandler explicitly.

Upvotes: 3

Related Questions