0
votes

Here's the relevant bit of my Web.Config:

<rule name="Force WWW and SSL" enabled="true" stopProcessing="true">
  <match url="(.*)" />
  <conditions logicalGrouping="MatchAny">
      <add input="{HTTP_HOST}" pattern="^[^www]" />
      <add input="{HTTPS}" pattern="off" />
  </conditions>
  <action type="Redirect" url="https://www.zzz.com/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>

It will rewrite http to https but will not add the www as needed by my cms. I've tried several variants of this and it just seems that IIS 8.5 on Win2012R2 refuses to follow the www rule. Any ideas?

2

2 Answers

0
votes

The problem comes from the pattern used to detected non-www.
You sould replace it like this :

<add input="{HTTP_HOST}" pattern="^zzz.com$" />
0
votes

Having hit the same problem, I fixed it by editing bindings for the site and adding an extra binding for zzz.com, just for http.