title: Redirect rule not working
body: <p>I'm trying to add a forwarding rule for my website. If any of the following URLs are matched:</p>
  
  <ol>
  <li><a href="https://www.example.com" rel="nofollow noreferrer">https://www.example.com</a> </li>
  <li><a href="http://example.com" rel="nofollow noreferrer">http://example.com</a></li>
  <li><a href="http://www.example.com" rel="nofollow noreferrer">http://www.example.com</a> </li>
  </ol>
  
  <p>then it should redirect to </p>
  
  <p>to <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a>  </p>
  
  <p>I am using URL Rewrite 2 for IIS on Windows 2016. </p>
  
  <p>I'm trying to break this into 2 rules as I can't think of how else to do it. The first part of the rule is from http to https </p>
  
  <pre><code>&lt;rule name="HTTP to HTTPS redirect" stopProcessing="true"&gt;
        &lt;match url="(.*)"/&gt;
        &lt;conditions&gt;
          &lt;add input="{HTTPS}" pattern="^OFF$" ignoreCase="true"/&gt;
          &lt;add input="{HTTP_HOST}" pattern="localhost" negate="true"/&gt;
        &lt;/conditions&gt;
        &lt;action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}"/&gt;
      &lt;/rule&gt;
    &lt;/rules&gt;
  </code></pre>
  
  <p>The above works.</p>
  
  <p>Now I need to work with <a href="https://www" rel="nofollow noreferrer">https://www</a> to https:// and this doesn't appear to be doing anything</p>
  
  <pre><code>&lt;rule name="www to no subdomain redirect" stopProcessing="true"&gt;
            &lt;match url="(.*)"/&gt;
            &lt;conditions&gt;
              &lt;add input="{HTTP_HOST}" pattern="^www" ignoreCase="true"/&gt;
            &lt;/conditions&gt;
            &lt;action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}"/&gt;
          &lt;/rule&gt;
        &lt;/rules&gt;
  </code></pre>
  
  <p>This means if I type in using <code>http</code> the rule works, but when I type in <a href="https://www.example.com" rel="nofollow noreferrer">https://www.example.com</a> it is not forwarding to <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a></p>
  
  <p>What am I doing wrong?</p>