title: Web.config. Redirect all traffic to www.my... Using rules element.
body: <p>I have a web.config file which automatically sends traffic to HTTPS. However, if someone enters in MyDomain.com then it will go to <a href="https://mydomain.com">https://mydomain.com</a> and if someone enters www.mydomain.com then it will go to <a href="https://www.mydomain.com">https://www.mydomain.com</a>.</p>
  
  <p>I want ALL traffic to go to <a href="https://www.mydomain.com">https://www.mydomain.com</a>. Is this possible using the rules element of the web.config? My file currently looks like this:</p>
  
  <pre><code>&lt;rewrite&gt;
    &lt;rules&gt;
        &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;/conditions&gt;
            &lt;action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" /&gt;
        &lt;/rule&gt;
    &lt;/rules&gt;
  </code></pre>
  
  <p></p>