Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can X-Powered-By response header be removed?
#10
(10-03-2018, 10:15 PM)LorenSzendre Wrote:
(10-03-2018, 08:44 PM)rchristi12 Wrote: Can you show me some code for how to use URL Rewrite?

And Chad -- is there a chance that I could remove the empty lines in the header? Perhaps a property of the ServerController to do some basic minification. Folks spend a fortune reducing the size of their output. It seems to me there is some low-lying fruit here...

Once you install URL Rewrite it shows up as an icon in the IIS configuration for your web application.  You can then double click it and use the GUI to create an outbound rule.  Or you can simply add the following inside your web.config file : 

<system.webServer>
  <rewrite>
     <outboundRules>
         <rule name="X-Powered-By">
             <match serverVariable="RESPONSE_X-POWERED-BY" pattern=".*" />
             <action type="Rewrite" />
         </rule>
     </outboundRules>
  </rewrite>
</system.webServer>

Keep in mind this does not eliminate the header X-Powered-By from being displayed entirely;  just replaces the value with nothing.
Reply


Messages In This Thread
RE: Can X-Powered-By response header be removed? - by rchristi12 - 10-04-2018, 02:32 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)