IIS 7出站规则不会重写HTML href

时间:2012-12-28 23:35:20

标签: html iis-7 rules outbound

我正在尝试使用outboundrule重写html响应,但它不起作用:这是我的入站和出站规则:

    <rules>             
    <rule name="IE56 Do not gzip js and css" stopProcessing="false">
            <match url="\.(css|js|emz|jpg|htm|html)" />
            <action type="None" />
            <serverVariables>
             <set name="HTTP_ACCEPT_ENCODING" value="" />
               </serverVariables>
    </rule>


<rule name="Route the requests for eserver" patternSyntax="ECMAScript">
    <match url="^eServer/(.*)" />
    <conditions logicalGrouping="MatchAny">
               <add input="{CACHE_URL}" pattern="^(https?)://" />
    </conditions>
    <action type="Rewrite" url="{C:1}://mckyesvr/eServer/{R:1}" />
    <serverVariables>
               <set name="HTTP_ACCEPT_ENCODING" value="" />
    </serverVariables>
    </rule>

      <outboundRules>               
    <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
     <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame,Img,    Input, Link, Script" pattern="^http(s)?://mckyesvr/eServer/(.*)" ignoreCase="true" />
        <conditions>
                       <add input="{URL}" pattern="/PageLoader" negate="true" />
        </conditions>
        <action type="Rewrite" value="/eServer/{R:2}" />
</rule>


<rule name="ReverseProxyOutboundRule8" preCondition="ResponseIsHtml1">
<match pattern="http://mckyesvr/eServer/PageLoader.asp?Page=Process_Safety.dsp"/>
<action type="Rewrite" value="/eServer/PageLoader.asp?Page=Process_Safety.dsp" />
</rule>

它们与几乎所有HTML响应完美配合,除了那些具有此HTML响应形式的响应:

    "<html xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns="http://www.w3.org/TR/REC-html40">

.......等等,这是我要重写的部分: &lt; _a href =“http://mckyesvr/eServer/PageLoader.asp?Page = Process_Safety.dsp”   target =“_ parent”&gt;返回流程安全------

我已经尝试过更改压缩,更改出站规则,移动一千个参数但是直到现在还没有任何工作,我不知道为什么会发生这种情况只是如上所示的HTML响应,它看起来像是编码的,因为Outboundrules没有捕获它。

0 个答案:

没有答案