Thursday 6 August 2015

Remove Server Response Header from asp.net web application

No comments
A frequently asked question is how to remove Server Response Header from all responses of web application (from aspx, css, js, html everything)... Now by googling you can see almost 5-8 types of solutions .. But most of them do not do your complete job (believe me i invested lot's of time on them) .. so the question is now among them which one is actually do your job ..

OK... first let me give you the answer so that you can get satisfied then i will let you know why it's the best one to choose .. append the below tag in web.config.If their are already <system.webServer> then also this will not create problem ...

 <system.webServer>
  <rewrite>
  <outboundRules>
 <rule name="changeServerHeader">
 <match serverVariable="RESPONSE_Server" pattern=".*" />
 <action type="Rewrite" value="" />
 </rule>
  </outboundRules>
  </rewrite>
  </system.webServer>

Try to keep it in separate <system.webServer>  so that, it do not disturb other setting elements in <system.webServer> like below (don't worry it will not create any problem ;))..



No comments :

Post a Comment