how to set asp.net web.config rewrite http to http

2019-09-06 12:04发布

I m very noob on the rewrite part, hope someone can help me. Now i m using this

<rewrite>
  <rules>
    <rule name="Imported Rule 1" stopProcessing="true">
      <match url="^(.*)" ignoreCase="false" />
      <conditions logicalGrouping="MatchAll">
        <add input="{HTTPS}" negate="true" pattern="^on$" ignoreCase="false" />
      </conditions>
      <action type="Redirect" url="https://{SERVER_NAME}/{R:1}" redirectType="Found" />
    </rule>
  </rules>
</rewrite>

This only can change http to https only, now I hope it can support to change www to non-www too. What should I do to do it?

1条回答
时光不老,我们不散
2楼-- · 2019-09-06 12:29

Why from web.config? You should allow it from IIS - just add it.

查看更多
登录 后发表回答