Forum Discussion
noorulahmed
Feb 26, 2025Copper Contributor
How to Hide 'Server' and 'X-Powered-By' response header tags
Hi,
We have a communication site published on SharePoint 2019 Farm environment, primary used as an intranet portal. During the recent penetration testing, our security team recommended to hide the HTTP response headers 'Server' and 'x-powered-by'. Can we have information on how to achieve it safely, and whether it can impact any website functionalities?
Regards
1 Reply
Sort By
- RioGrandeIron Contributor
1. Use IIS Manager to hide the Server header:
Open IIS Manager and select the SharePoint site.
Double-click the HTTP Response Header feature.
In the right action panel, click Delete to remove the Server header.
Use URL rewrite rules to hide the Server header:
Open IIS Manager and select the SharePoint site.
Double-click the URL Rewrite feature.
In the right action panel, click Add Rule and select Blank Rule.
Configure the rule to match all requests and add RESPONSE_Server to the Server Variables and set the value to null.
2. Hide the X-Powered-By header:
Open IIS Manager and select the SharePoint site.
Double-click on the HTTP Response Headers feature.
In the right action panel, click Delete to remove the X-Powered-By header.
3. Use a PowerShell script:
Open the SharePoint Management Shell (with administrator privileges).
Use the following command to disable the X-Powered-By header:
powershell
Set-WebConfigurationProperty -PSPath “IIS:\Sites\SharePointSite” -Filter “system.webServer/httpProtocol/customHeaders” -Name “X-Powered- By” -Value ””
Configure the Web.config file:
Open the Web.config file for the SharePoint site (usually located at C:\inetpub\wwwroot\wss\VirtualDirectories\<port>).
Add the following to the <system.webServer> section to hide the X-Powered-By header:
xml
<httpProtocol>
<customHeaders
<remove name=“X-Powered-By” />
</customHeaders
</httpProtocol
Running HTML
4. Use third-party tools:
If you need more power, you can use a third-party tool (URLScan) to manage and hide response headers.
5. Contact Microsoft Support:
If the issue remains unresolved, submit a support request through the Microsoft 365 Administrator Center.
Provide detailed error messages and screenshots to quickly diagnose the issue.