title: iis 7 subdomain rewrite reverse proxy to internal servers
body: <p>On Server2008 systems, ARR/URL rewrite installed. Incoming traffic to ARR server ('pirate.mydomain.com'), that server in DMZ. Internal IIS servers (Server 2008/URL rewrite), single IIS site ('static.mydomain.com') containing dept sub-sites (static.mydomain.com/deptone, static.mydomain.com/depttwo, etc).</p>
  
  <p>At server level on ARR server, ARR server proxy settings: 'enable proxy' enabled, 'useurl rewrite to inspect incoming requests' enabled, 'reverse proxy' set to 'pirate.mydomain.com'.</p>
  
  <p>Intent is to have deptone.mydomain.com rewritten (not redirected) to static.mydomain.com/deptone .... and depttwo.mydomain.com rewritten to static.mydomain.com/depttwo . </p>
  
  <p>URL should not change in the visitors' browser.</p>
  
  <p>At IIS site level for 'pirate.mydomain.com', URL rewrite rule as follows:</p>
  
  <pre><code>&lt;rule name="deptone redirect" stopProcessing="true"&gt;
  &lt;match url=".*" /&gt;
  &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="false"&gt;
  &lt;add input="{HTTP_HOST}" pattern="^(www.)?pirate.mydomain.com/(deptone)(.*)" /&gt;
  &lt;/conditions&gt;
  &lt;action type="Rewrite" url="http://static.mydomain.com/deptone{C:3}" appendQueryString="false" /&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p>THis is not working; I am getting 400.0 error ('max forwards limit'). </p>
  
  <p>Need guidance for URL rewrite rule for this process. Have been to the IIS forums/help, but still cannot get this working.</p>
  
  <p>Thanks.</p>