views:

188

answers:

3

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" />
+1  A: 

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

hunter
Yeah, that's what I thought, but how do you do this? StaticFileHandler is an internal class, so I can't use it at the end of the Handler, and you can't add it in the web.config as, if it's picked up by the ReWriteHandler, then it doesn't move on to the next one...
Paul
Try giving the static handler a path and just Redirect() to it from the RewriteHandler
hunter
A: 

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.

alex
+1  A: 

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.

Branislav Abadjimarinov