0

I am using the below handler in by web.config file. The problem i am now faced with is that i have .htm files in a particular directory that i need to be excluded from this handler. Is there a way to do this?

<add name="ASPNETLikeHandler-Classichtm" path="*.htm" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" requireAccess="Script" preCondition="classicMode" />

So when a certain directory is targeted i want the .htm files to behave as they would by default. Is this even possible?

jackncoke
  • 2,000
  • 6
  • 25
  • 66
  • is this solution applicable? http://stackoverflow.com/questions/2509770/how-do-i-exclude-things-that-match-the-specified-path-for-an-httphandler-in-asp – rogerdeuce Apr 13 '15 at 14:17
  • @rogerdeuce the sudo code they're is making it a little confusing for me to see how i could apply that to my situation. I need to basically say don't apply handler when a request is made for this directory. Kind of like a precondition but i didn't see any valid preconditions that i could apply to make this happen. – jackncoke Apr 13 '15 at 16:06
  • I've haven't had the pleasure of using these yet but, it looks like you can exclude a specific directory. I think you would use the remove syntax in that answer, along with the directory option listed in 'UI elements for handler mappings' here: https://technet.microsoft.com/en-us/library/hh831697.aspx – rogerdeuce Apr 13 '15 at 16:19

1 Answers1

5

Place a web.config file into the directory you want ignored and remove the handler

<system.webServer>
     <handlers>
       <remove name="ASPNETLikeHandler-Classichtm" />
     </handlers>
</system.webServer>
Shane Neuville
  • 2,127
  • 14
  • 19
  • 1
    I am doing the exact same thing as the OP, this solution fixed the Server 500 errors I was getting. – adamc-au Nov 10 '16 at 11:44