I am using below configuration to achieve the same and is working perfectly on local machine but not working after deployment.
- <httpProtocol>
- <customHeaders>
- <remove name="X-Powered-By" />
- </customHeaders>
- </httpProtocol>
- <rewrite>
- <!--<rules>
- <rule name="ensurewww" stopProcessing="true">
- <match url=".*" />
- <conditions>
- <add input="{CACHE_URL}" pattern="^(.+)://(?!www)(.*)" />
- </conditions>
- <action type="Redirect" url="{C:1}://www.{C:2}" redirectType="Permanent" />
- </rule>
-
- </rules>-->
- <outboundRules rewriteBeforeCache="true">
- <rule name="Remove Server header">
- <match serverVariable="RESPONSE_Server" pattern=".+" />
- <action type="Rewrite" value="" />
- </rule>
- </outboundRules>
- </rewrite>