How to add a custom HTTP response header to a Web site that is hosted by IIS


INTRODUCTION


This article discusses how to add a custom HTTP response header to a Web site that is hosted by Internet Information Services (IIS) 7.0, by IIS 6.0, or by earlier versions of IIS. This header may apply to a site or to an application.

You can also add custom HTTP response headers at the server level. However, we recommend that you use custom headers only on a specific site or application. We do not recommend that you use custom headers globally.

More Information


To add a custom HTTP response header at the Web site level in IIS 7.0 on a computer that is running Windows Server 2008, follow these steps:
  1. Click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.
  2. In the connections pane, expand the node for the server, and then expand Sites.
  3. Click the Web site where you want to add the custom HTTP response header.
  4. In the Web site pane, double-click HTTP Response Headers in the IIS section.
  5. In the actions pane, click Add.
  6. In the Name box, type the custom HTTP header name.
  7. In the Value box, type the custom HTTP header value.
  8. Click OK.
To add a custom HTTP response header at the Web site level in IIS 6.0 and in earlier versions of IIS, follow these steps:
  1. Click Start, click Run, type inetmgr.exe, and then click OK.
  2. Expand the node for the server, and then expand Web Sites.
  3. Right-click the Web site, and then click Properties.
  4. Click the Custom HTTP headers tab, and then click Add.
  5. In the Custom header name box, type the custom HTTP header name.
  6. In the Custom header value box, type the custom HTTP header value.
  7. Click OK two times.