I've g开发者_Go百科one through many suggestions here and on the web, and still am failing to make this work. I currently have the following, but it's not working. All help appreciated!
<rules>
   <rule name="www-less redirect" stopProcessing="true">
   <match url="(.*)" />
     <conditions>
      <add input="{HTTP_HOST}" pattern="^example\.com$" />
                </conditions>
                <action type="Redirect" url="http://www.example.com/{R:1}" />
              </rule>
        </rules>
Your rule seems fie. Try this one (slightly different) -- works fine for me:
<rule name="CanonicalHostName">
    <match url="(.*)" />
    <conditions>
        <add input="{HTTP_HOST}" pattern="^www\.example\.com$" negate="true" />
    </conditions>
    <action type="Redirect" url="http://www.example.com/{R:1}" />
</rule>
1) Try moving this rule to the top (make it first rule).
2) Possibly (just possibly) you do not have binding for example.com, only for www.example.com ?
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论