IIS Handlers exclude a Directory when processing htm requests

前提是你 提交于 2019-12-12 06:37:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!