IIS 10 server behind an AWS application load balancer will not redirect traffic for domain without www when client requests http rather than https. The rule to redirect traffic when www is specified works fine, but 404 is returned if you try the same url without www.
So:
Enter "http://dname.com/blog" = 404
Enter "http://www.dname.com/blog" = redirect to "https://www.dname.com/blog"
<rule name="Force HTTPS" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{HTTP_X_Forwarded_Proto}" pattern="^https$" negate="true" /> <add input="{HTTP_HOST}" pattern="^dname\.com$" /> </conditions> <action type="Rewrite" url="https://www.dname.com{REQUEST_URI}" /> </rule> <rule name="Force WWW HTTPS" enabled="true" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{HTTP_X_Forwarded_Proto}" pattern="^https$" negate="true" /> <add input="{HTTP_HOST}" pattern="^www\.dname\.com$" /> </conditions> <action type="Redirect" url="https://www.dname.com{REQUEST_URI}" /> </rule>