title: IIS URL Rewrite not working after first forward slash, but URL forward works fine
body: <p>So if I enter a url like: <a href="http://sample.com/maindir/test123" rel="noreferrer">http://sample.com/maindir/test123</a> my Rewrite works fine. If I enter a url like: <a href="http://sample.com/maindir/test123/test234" rel="noreferrer">http://sample.com/maindir/test123/test234</a> it breaks, giving a 500 error. Both of these work if I change it to a redirect instead of rewrite rule</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;rule name="Test" stopProcessing="true"&gt;
      &lt;match url="^maindir\/?(?:([^\/]+))?\/?(?:([^\/]+))?\/?(?:([^\/]+))?\/?(?:([^\/]+))?\/?" /&gt;
      &lt;action type="Rewrite" url="maindir/?a1[]={R:1}&amp;amp;a1[]={R:2}&amp;amp;a1[]={R:3}&amp;amp;a1[]={R:4}" /&gt;
      &lt;conditions&gt;
          &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&gt;
      &lt;/conditions&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p>After much frustration with this, trying to find a solution, I figured I would see if anyone else can see what's going on here. Thank you in advance.</p>