Related Tags:
Asp.Net It was developed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. Learn More, C# C# (pronounced "C-sharp") is an object-oriented programming language from Microsoft that aims to combine the computing power of C++ with the programming ease of Visual Basic. C# is based on C++ and contains features similar to those of Java. Learn More, ASP.NET MVC The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc assembly. Learn More, IIS (Internet Information Services) IIS Stands for "Internet Information Services." IIS is a web server software package designed for Windows Server. It is used for hosting websites and other content on the Web. Microsoft's Internet Information Services provides a graphical user interface (GUI) for managing websites and the associated users. Learn More, IIS URL Rewrite The URL Rewrite Module is an extension software for IIS (Internet Information Services). URLs should be created so that they are easy to remember for the users and easy to find for the search engines. The URL Rewrite Module enables web administrators to develop and implement rules that assist them in this task. Learn More, web.config A configuration file (web.config) is used to manage various settings that define a website. The settings are stored in XML files that are separate from your application code. ... Generally a website contains a single Web.config file stored inside the application root directory. Learn More,

remove server information from response header using web.config in different versions of IIS?

Description:I have different sites hosted on multiple environments one is using IIS 8 and the other one is using IIS 10 , I wanted to remove the server information from the response header using web.config and currently I am using following URL Rewrite Outbound rule but unfortunately it is not working in any of the environment.


<rewrite>
<outboundRules rewriteBeforeCache="true">
<rule name="Remove Server header">
<match serverVariable="RESPONSE_Server" pattern=".+" />
<action type="Rewrite" value="" />
</rule>
</outboundRules>
</rewrite>

Posted by: | Posted on: Mar 17, 2022

1 answers

Replies

4

You can use the following code for both IIS versions, it will make the server variable empty in the response header.

<rewrite>
<outboundRules>
<rule name="ModifyServer">
<match serverVariable="RESPONSE_SERVER" pattern=".*" />
<action type="Rewrite" value="" />
</rule>
</outboundRules>
<rewrite>

Replied by: | Replied on: Mar 21, 2022



Reply
×

Code block Hyperlink bold Quotes block Upload Images

Preview