简体   繁体   English

HTTP 响应标头未使用 URL 重写(出站规则)从所有网站中删除

[英]HTTP Response Headers not removed from all website using URL Rewrite (Outbound Rule)

I applied server level Outbound Rule in IIS URL Rewrite section for RESPONSE_VARY, RESPONSE_X-POWERED-BY and RESPONSE_SERVER using pattern value ".+" for hiding information from browser header.It is working fine only for.aspx pages but when I click.css file,.js or.jpg through developer tools still information is showing. I applied server level Outbound Rule in IIS URL Rewrite section for RESPONSE_VARY, RESPONSE_X-POWERED-BY and RESPONSE_SERVER using pattern value ".+" for hiding information from browser header.It is working fine only for.aspx pages but when I click.css文件、.js 或.jpg 通过开发人员工具仍然显示信息。 I checked all folders in IIS all rules are available because I applied at server level but why it is working for.aspx extension and not for others extensions.我检查了 IIS 中的所有文件夹,所有规则都可用,因为我在服务器级别应用,但为什么它适用于 .aspx 扩展而不适用于其他扩展。 I want these rules applied all over the website.我希望这些规则适用于整个网站。

I can rewrite content type and X-powered-by for static content with rule below.我可以使用以下规则重写 static 内容的内容类型和 X-powered-by。

在此处输入图像描述

    <outboundRules>
        <rule name="rewriterule1">
            <match filterByTags="None" serverVariable="RESPONSE_Content-Type" pattern="(.*)" />
            <action type="Rewrite" value="" />
        </rule>
        <rule name="rewriterule2">
            <match serverVariable="RESPONSE_X-POWERED-BY" pattern="(.*)" />
            <action type="Rewrite" value="" />
        </rule>
    </outboundRules>

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM