title: IIS Rewrite URL Condition Grouping
body: <p>I'm redirecting my website URLs to mobile with the following conditions:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;conditions logicalGrouping="MatchAny"&gt;
    &lt;add input="{HTTP_USER_AGENT}" pattern="midp|mobile|phone" /&gt;
    &lt;add input="{HTTP_X-Device-User-Agent}" pattern="midp|mobile|phone" /&gt;
    &lt;add input="{HTTP_X-OperaMini-Phone-UA}" pattern="midp|mobile|phone" /&gt;
    &lt;add input="{StaticRedirects:{R:1}}" pattern="(.+)" /&gt;
  &lt;/conditions&gt;
  </code></pre>
  
  <p>I want to group these first three conditions together and the last one separately.</p>
  
  <p>Redirect rule must be applied if:</p>
  
  <ol>
  <li><code>HTTP_USER_AGENT</code> or <code>HTTP_X-Device-User-Agent</code> or <code>HTTP_X-OperaMini-Phone-UA</code> matches the pattern</li>
  <li>and <code>{StaticRedirects:{R:1}}</code> matches the pattern</li>
  </ol>
  
  <p>Is there any way for grouping these conditions?</p>
  
  <p><strong>PS:</strong> I have nearly 10 rules. Do I have to write first three conditions for each of my rules or is there any tag for all rules?</p>