title: Add trailing slash to applications path if one does not exist, C# app running on IIS
body: <p>I know this can be done with URL Rewrite but this is a customer machine where they don't want to install extensions unless they really have to. The application is running in a folder under the original domain name like this:</p>
  
  <p>domain.com/app1</p>
  
  <p>If a request is made to <code>domain.com/app1</code> I wan't it to be permanently redirected to <code>domain.com/app1/</code>.</p>
  
  <p>Application and IIS:</p>
  
  <ul>
  <li>.NET Framework 4.5</li>
  <li>IIS 7.0</li>
  </ul>
  
  <p>Example rule that is last resort:</p>
  
  <pre><code>&lt;rule name="Add trailing slash" stopProcessing="true"&gt;
    &lt;match url="(.*[^/])$" /&gt;
    &lt;conditions&gt;
      &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt;
      &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&gt;
    &lt;/conditions&gt;
    &lt;action type="Redirect" redirectType="Permanent" url="{R:1}/" /&gt;
  &lt;/rule&gt;
  </code></pre>