Thursday, July 23, 2009

HTml Files not Being Served By IIS7

For a few days I was wondering when I moved my customers ASP application from DailyRazor to Godaddy, it simply does not server .html, .txt, .pdf, etc files. The only diference (Though a huge difference) is the change of server fomr IIS6 - IIS7). I called their support just to be answered by an Idiot.

Finally I started my classic debugging.

Started from URLRewriter by YAF.net

I noticed one thing, if the web.config just has the default stuff, everything is fine (Except .aspx because it doesn't have any registered dlls)

So I started removing the tags one by one from the web.config. Finally, understood, the problem lied in this particulr entry:



I still don't remember when I added this part to the web.config.

Also I added the following to the web.config for the html files to be served:

<add validate="false" path="*.html" verb="*" type="System.Web.DefaultHttpHandler"></add>


</remove name="StaticFile"/>