Dual rewrite rules (WWW prefix and HTTPS) I want to configure my website to force a www. prefix on the name, and the HTTPS protocol.

&lt;system.webServer&gt;
  &lt;rewrite xdt:Transform="Insert"&gt;
    &lt;rules&gt;
      &lt;clear/&gt;
      &lt;rule name="Add WWW prefix" enabled="true"&gt;
        &lt;match url="(.*)" ignoreCase="true" /&gt;
        &lt;conditions&gt;
          &lt;add input="{HTTP_HOST}" negate="true" pattern="^www\.(.*)$" /&gt; &lt;!--pattern="^www\.([.a-zA-Z0-9]+)$"/&gt;--&gt;
        &lt;/conditions&gt;
        &lt;action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" appendQueryString="true" redirectType="Permanent"/&gt;
      &lt;/rule&gt;
      &lt;rule name="Redirect to HTTPS" enabled="true" stopProcessing="true"&gt;
        &lt;match url="(.*)" ignoreCase="true" /&gt;
        &lt;conditions&gt;
          &lt;add input="{HTTPS}" pattern="^OFF$" /&gt;
        &lt;/conditions&gt;
        &lt;action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" /&gt;
      &lt;/rule&gt;--&gt;
    &lt;/rules&gt;
  &lt;/rewrite&gt;
&lt;/system.webServer&gt;


Considerations:


The first rule appears to be working fine.
The second rule is so far untested on the live site. (Still configuring SSL.)
Are there any performance considerations when applying two rules together like this? That is, must they both be applied on each request.
Redirecting twice does cause a slight performance impact, but if you are looking to use HSTS then you should use two redirects, as there are some situations where going direct from http://example.com to https://www.example.com would cause issues.

An example is the HSTS preload list, where you must:

2) Redirect from HTTP to HTTPS on the same host, if you are listening on port 80.
https://hstspreload.org/

So you will need to make sure the redirect chain goes:

http://example.com -> https://example.com -> https://www.example.com