如何设置asp.net web.config将http重写为https,将www重写为非www
我在重写方面很在行,希望有人能帮我。 现在我用这个如何设置asp.net web.config将http重写为https,将www重写为非www,asp.net,url,rewrite,Asp.net,Url,Rewrite,我在重写方面很在行,希望有人能帮我。 现在我用这个 <rewrite> <rules> <rule name="Imported Rule 1" stopProcessing="true"> <match url="^(.*)" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{H
<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>
这只能将http更改为https,现在我希望它也能支持将www更改为非www。我该怎么做呢 为什么从web.config?您应该允许它从IIS访问-只需添加即可。我正在使用共享主机,无法直接进入IIS,我只能使用web.config进行设置。