问题
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?
回答1:
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>
来源:https://stackoverflow.com/questions/29606210/iis-handlers-exclude-a-directory-when-processing-htm-requests