I have a simple website and I would like to eliminate the www and force it to be https.

I managed to get 3 of the possible combinations working but am stuck on the last one.

* <http://website.tld> -> <https://website.tld> (OK)
* <https://website.tld> -> <https://website.tld> (OK)
* <http://www.website.tld> -> <https://website.tld> (OK)
* **<https://www.website.tld> -> <https://website.tld> (KO)**

---

I am using URL rewrite with code borrowed from other questions asked here. I have the following 2 rules enabled:

```
    <rule name="Remove www" enabled="true" stopProcessing="true">
      <match url="(.*)" negate="false"></match>
      <conditions>
        <add input="{HTTP_HOST}" pattern="^www\.(.*)$" />
      </conditions>
      <action type="Redirect" url="https://{C:1}/{R:1}" appendQueryString="true" redirectType="Permanent" />
    </rule>
    <rule name="Force HTTPS" enabled="true">
      <match url="(.*)" ignoreCase="false" />
      <conditions>
        <add input="{HTTPS}" pattern="off" />
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
    </rule>

```

I have the following URL redirects:

* www.website.tld → <https://website.tld>
* (\*) → <https://website.tld>

Any idea how I can cover this condition?

Thanks