Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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" />
like image 717
Paul Avatar asked Jan 26 '10 23:01

Paul


2 Answers

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

like image 106
hunter Avatar answered Sep 29 '22 21:09

hunter


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.

like image 29
alex Avatar answered Sep 29 '22 21:09

alex