如何设置asp.net web.config将http重写为https,将www重写为非www [英] how to set asp.net web.config rewrite http to https and www to non-www
本文介绍了如何设置asp.net web.config将http重写为https,将www重写为非www的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在重写部分非常菜鸟,希望有人可以帮助我.现在我正在使用
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>
这只能将http更改为https,现在我希望它也支持将www更改为非www.我该怎么做?
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?
推荐答案
为什么要使用web.config?您应该从IIS允许它-只需添加它即可.
Why from web.config? You should allow it from IIS - just add it.
这篇关于如何设置asp.net web.config将http重写为https,将www重写为非www的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文