赞
踩
IIS版本:IIS10
已安装URL Rewrite模块
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <outboundRules rewriteBeforeCache="true"> <rule name="Remove Server header"> <match serverVariable="RESPONSE_SERVER" pattern=".+" /> <action type="Rewrite" value="" /> </rule> <rule name="Remove X-POWERED-BY"> <match serverVariable="RESPONSE_X-POWERED-BY" pattern=".+" /> <action type="Rewrite" value="" /> </rule> <rule name="Remove X-ASPNET-VERSION"> <match serverVariable="RESPONSE_X-ASPNET-VERSION" pattern=".+" /> <action type="Rewrite" value="" /> </rule> </outboundRules> </rewrite> </system.webServer> </configuration>
通过以上设置,可以把响应信息中的server,x-powered-by和x-aspnet-version设置为空,也可以通过更改value,设置为自定义值。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。