title: IIS Rewrite rule - if path does not have query string
body: <p>How do I write IIS Rewrite rule <code>if path does not have query string and any capital letter exists in path then redirect to same path with lower case</code>?</p>
  
  <p>e.g.<br/> 
  <a href="http://localhost:62871/Second.aspx/Test?X=Y" rel="nofollow noreferrer">http://localhost:62871/Second.aspx/Test?X=Y</a> <br/>
  redirects to: <a href="http://localhost:62871/second.aspx/test?X=Y" rel="nofollow noreferrer">http://localhost:62871/second.aspx/test?X=Y</a></p>
  
  <p>Following rule works but it lower cases the querystring too:</p>
  
  <pre><code>    &lt;rewrite&gt;
          &lt;rules&gt;
              &lt;rule name="LowerCaseRule1" stopProcessing="true"&gt;
                  &lt;match url="[A-Z]" ignoreCase="false" /&gt;
                  &lt;action type="Redirect" url="{ToLower:{URL}}" /&gt;
              &lt;/rule&gt;
          &lt;/rules&gt;
      &lt;/rewrite&gt;
  </code></pre>