首先在Global.asax.cs里增加:
PRotected void application_PreSendRequestContent(object sender, EventArgs e)
{
HttpContext.Current.Response.Headers.Set(“Server”, “w3cnet.com”);
HttpContext.Current.Response.Headers.Remove(“X-aspNet-Version”);
HttpContext.Current.Response.Cookies.Remove(“.ASPXAUTH”);
}
然后web.config的system.webServer节点下增加:
<httpProtocol>
<customHeaders>
<remove name=”X-Powered-By” />
</customHeaders>
</httpProtocol>
再看看响应头,或用站长工具查看,完美隐藏。
转自:http://fenglongsheng.com/post/7566.html
新闻热点
疑难解答