Sachin Singh

Sachin Singh

  • 10
  • 55.8k
  • 75.2k

Remove unnecessary server information

Aug 8 2020 1:08 AM
I am using below configuration to achieve the same and is working perfectly on local machine but not working after deployment.
 
  1. <httpProtocol>  
  2.       <customHeaders>  
  3.         <remove name="X-Powered-By" />  
  4.       </customHeaders>  
  5.     </httpProtocol>  
  6.     <rewrite>  
  7.       <!--<rules>  
  8.     <rule name="ensurewww" stopProcessing="true">  
  9.       <match url=".*" />  
  10.       <conditions>  
  11.         <add input="{CACHE_URL}" pattern="^(.+)://(?!www)(.*)" />  
  12.       </conditions>  
  13.       <action type="Redirect" url="{C:1}://www.{C:2}" redirectType="Permanent" />  
  14.     </rule>  
  15.           
  16.       </rules>-->  
  17.       <outboundRules rewriteBeforeCache="true">  
  18.         <rule name="Remove Server header">  
  19.           <match serverVariable="RESPONSE_Server" pattern=".+" />  
  20.           <action type="Rewrite" value="" />  
  21.         </rule>  
  22.       </outboundRules>  
  23.     </rewrite> 
 

Answers (2)