title: IIS Reverse Proxy Apply outbound rule on specific path
body: <p>I have the following inbound and outbound rules defined to get my reverse proxy working.</p>
  
  <pre><code>&lt;rewrite&gt;
      &lt;rules&gt;
          &lt;rule name="Route the requests for backend app" stopProcessing="true"&gt;
              &lt;match url="^foldera/folderb/(.*)" /&gt;
              &lt;conditions&gt;
                  &lt;add input="{HTTP_HOST}" pattern="www.site1.com" /&gt;
              &lt;/conditions&gt;
              &lt;action type="Rewrite" url="http://www.site2.com/{R:1}" /&gt;
              &lt;serverVariables&gt;
                  &lt;set name="HTTP_ACCEPT_ENCODING" value="" /&gt;
              &lt;/serverVariables&gt;
          &lt;/rule&gt;
      &lt;/rules&gt;
      &lt;outboundRules&gt;
          &lt;rule name="RewriteRelativePaths" preCondition="ResponseIsHtml" enabled="true" stopProcessing="false"&gt;
              &lt;match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^/(.*)" /&gt;
              &lt;action type="Rewrite" value="/foldera/folderb/{R:1}" /&gt;
              &lt;conditions&gt;
                  &lt;add input="{URL}" pattern="^/foldera/folderb/.*" /&gt;
              &lt;/conditions&gt;
          &lt;/rule&gt;
          &lt;preConditions&gt;
              &lt;preCondition name="ResponseIsHtml"&gt;
                  &lt;add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /&gt;
              &lt;/preCondition&gt;
          &lt;/preConditions&gt;
      &lt;/outboundRules&gt;
  &lt;/rewrite&gt;
  </code></pre>
  
  <p>Now, the site "<a href="http://www.site2.com/" rel="nofollow">http://www.site2.com/</a>" is correclty loaded in "<a href="http://www.site1.com/foldera/folderb/" rel="nofollow">http://www.site1.com/foldera/folderb/</a>" and the outbound rule is making sure that every resource from site2 is rewritten to <a href="http://www.site1.com/foldera/folderb/" rel="nofollow">http://www.site1.com/foldera/folderb/</a>{resourcefromsite1}
  Unfortunately, the outbound rule is also crashing the rest of my site. Probably because he's trying to rewrite every native resource to this same "<a href="http://www.site1.com/foldera/folderb/" rel="nofollow">http://www.site1.com/foldera/folderb/</a>" folderstructure.
  How can I make the outbound rule only to respond to resources that are requested/loaded through path <a href="http://www.site1.com/foldera/folderb/" rel="nofollow">http://www.site1.com/foldera/folderb/</a> and for instance not through <a href="http://www.site1.com/foldera" rel="nofollow">http://www.site1.com/foldera</a></p>
  
  <p>Cheers
  Jeroen</p>