title: HTTP to HTTPS redirect for only one URL
body: <p>Was wondering if anybody could help. Thanks so much!</p>
  
  <p><strong>Problem</strong>:</p>
  
  <ul>
  <li><em>blog.example.com</em> </li>
  <li><p><em>cool.example.com</em></p>
  
  <p>redirect to <em>https://www.example.com</em>  </p></li>
  </ul>
  
  <p><strong>Goal</strong>:</p>
  
  <p>We're trying to only redirect </p>
  
  <ul>
  <li><p><em>http://example.com</em>  </p></li>
  <li><p><em>http://www.example.com</em></p>
  
  <p>to <em>https://www.example.com</em></p></li>
  </ul>
  
  <p><strong>Current code</strong></p>
  
  <p>Current code in web.config is this.  Stuck on <code>&lt;match url="(.*)"&gt;</code></p>
  
  <p>Below is rest of rewrite rule.</p>
  
  <pre><code>&lt;system.webServer&gt;     
   &lt;rewrite&gt;
      &lt;rules&gt;
         &lt;rule name="Redirect to https"&gt;
            &lt;match url="(.*)" /&gt;
            &lt;conditions&gt;
               &lt;add input="{SERVER_PORT}" pattern="443" negate="true" /&gt;
            &lt;/conditions&gt;
            &lt;action type="Redirect" url="https://www.example.com" /&gt;
         &lt;/rule&gt;
      &lt;/rules&gt;
   &lt;/rewrite&gt;
  &lt;modules runAllManagedModulesForAllRequests="true"/&gt;
  &lt;defaultDocument enabled="true"&gt;
    &lt;files&gt;
      &lt;clear/&gt;    
      &lt;!--Remove this line or place below to deprecate--&gt;
      &lt;add value="default.aspx"/&gt;
      &lt;add value="index.html"/&gt;
      &lt;add value="index.php"/&gt;
      &lt;add value="default.html"/&gt;
    &lt;/files&gt;
  &lt;/defaultDocument&gt;
  </code></pre>
  
  <p></p>