简体   繁体   中英

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 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. I want these rules applied all over the website.

I can rewrite content type and X-powered-by for static content with rule below.

在此处输入图像描述

    <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>

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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