title: IIS 7 courtesy trailing slash appears to clash with my URL Rewrite rule
body: <p>I'm just starting to work with URL Rewrite 2.0 in c#.net web.config.  My web.config looks like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;rewrite&gt;
    &lt;rules&gt;
      &lt;rule name="RemoveTrailingSlashRule2" stopProcessing="true"&gt;
        &lt;match url="(.*)/$" /&gt;
        &lt;conditions&gt;
          &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/&gt;
          &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt;
        &lt;/conditions&gt;
      &lt;action type="Redirect" url="{R:1}" /&gt;
    &lt;/rule&gt;
   &lt;/rules&gt;
  &lt;/rewrite&gt;
  </code></pre>
  
  <p>This should remove the trailing slash on a URL.  When I run the app, the rule appears to work at the root level, so this...</p>
  
  <pre class="lang-xml prettyprint-override"><code>www.mysite.com/
  </code></pre>
  
  <p>...gets redirected to...</p>
  
  <pre class="lang-xml prettyprint-override"><code>www.mysite.com/
  </code></pre>
  
  <p>...but the redirect doesn't work at other levels.</p>
  
  <p>So the problem is that this...</p>
  
  <pre class="lang-xml prettyprint-override"><code>www.mysite.com/pages/
  </code></pre>
  
  <p>...ends up with the trailing slash staying in place and if I try this...</p>
  
  <pre class="lang-xml prettyprint-override"><code>www.mysite.com/pages
  </code></pre>
  
  <p>...the trailing slash is actually APPENDED.</p>
  
  <p>My guess is that this is the 'courtesy trailing slash' that IIS 7 adds, but I don't know how to get the URL Rewrite rule to override it?</p>