西数超哥博客
运维经验教程分享

web.config禁止某个目录下的某类型文件访问(禁止html/php/asp访问)

web.config规则中禁止显示某个目录下的指定类型文件,如下,表示App/Tpl/目录下的所有html文件都显示403错误,

  1. <rule name=“disableDownloadHtml”>
  2. <match url=“^App/Tpl/.*.html$” ignoreCase=“true” /> //禁止app/tpl目录下的html文件访问
  3. <action type=“CustomResponse” url=“/” statusCode=“403” statusReason=“Forbidden” statusDescription=“Forbidden” />
  4. </rule>
<rule name="disableDownloadHtml">
   <match url="^App/Tpl/.*.html$" ignoreCase="true" /> //禁止app/tpl目录下的html文件访问
   <action type="CustomResponse" url="/" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule>

&nbsp;

赞(0)
声明:本站发布的内容(图片、视频和文字)以原创、转载和分享网络内容为主,若涉及侵权请及时告知,将会在第一时间删除。本站原创内容未经允许不得转载:西数超哥博客 » web.config禁止某个目录下的某类型文件访问(禁止html/php/asp访问)