IIS前台配置会和web.config相互影响。
一、允许通过的请求谓词
请求谓词有:HEAD、POST、GET、TRACE、OPTIONS。
设置方法有两种:
-
web.config配置
此配置会直接显示在IIS中。<system.webServer> <security> <requestFiltering> <verbs allowUnlisted="false"> <add verb="GET" allowed="true"/> <add verb="POST" allowed="true"/> </verbs> </requestFiltering> </security> </system.webServer>
-
IIS直接设置
直接设置的也会显示字在web.config文件中。
二、设置打不开某个特定的地址
-
web.config
<system.webServer> <rewrite> <rules> <clear /> <rule name="Ban" stopProcessing="true"> <match url="^(?!.*\\.js$).*\.js$" />//正则表达式匹配的段落 <action type="Redirect" url="http://10.72.66.7/404page/404.htm" />//触发上面匹配的网址,就打开这个连接 <conditions></conditions> </rule> </rewrite> </system.webServer> </configuration>
-
前台配置
没这个URL重写功能需要自己安装,自行百度。