大网数据广告活动
Web服务器与PHP

Add an HTTP response header to a web site

· 52CE 我爱测

Explains how to add a custom HTTP response header to a Web site that's hosted by Internet Information Services (IIS).

This article discusses how to add a custom HTTP response header to a web site that's hosted by IIS. This header may apply to a site, or an application.

Original product version:   Internet Information Services 7.0
Original KB number:   954002

Add custom HTTP response header in IIS 7.0

To add a custom HTTP response header at the web site level in IIS 7.0 on a Windows Server 2008 computer, follow these steps:

  1. Select Start, select Administrative Tools, and then select Internet Information Services (IIS) Manager.
  2. In the connections pane, expand the node for the server, and then expand Sites.
  3. Select 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, select Add.
  6. In the Name box, type the custom HTTP header name.
  7. In the Value box, type the custom HTTP header value.
  8. Select OK.

More information

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

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 03/27/2020
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。