【问题标题】:Add custom http response headers for files matching conditions为匹配条件的文件添加自定义 http 响应标头
【发布时间】:2017-07-11 12:51:04
【问题描述】:

我需要为来自 IIS 8.5 的每个 http 响应添加自定义 http 标头,但仅限于特定文件类型(css、js 和 html)。

我已经尝试过这个解决方案 Add custom header based on file type,但它似乎已经过时了,而且我收到错误的 web.config 文件错误。

如何在 IIS 8.5 上完成?
任何帮助将不胜感激。

【问题讨论】:

    标签: iis http-headers web-config


    【解决方案1】:

    此链接上的解决方案仍然有效Add custom header based on file type 解决您的问题。

    您无法使用它,因为您需要为 IIS 安装 URL Rewrite 模块。

    请到https://www.iis.net/downloads/microsoft/url-rewrite,下载安装后重启IIS。完成此步骤后,有关错误 web.config 文件的错误应该消失了

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-14
      • 2015-01-24
      • 2012-11-09
      相关资源
      最近更新 更多