[英]redirect https://www to https:// through web.config
I want to redirect anything to https://domain.com 我想将任何内容重定向到https://domain.com
I found this code: 我找到了这段代码:
<rewrite>
<rules>
<rule name="SecureRedirect" stopProcessing="true">
<match url="^(.*)$" />
<conditions>
<add input="{HTTPS}" pattern="off" />
<add input="{HTTP_HOST}" pattern="^(www\.)?(.*)$" />
</conditions>
<action type="Redirect" url="https://{C:2}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
And its working except on https://www.domain.com 它的工作除了https://www.domain.com
My virtual server is Windows Server 2012 with IIS 8, and the domain is https://kajsystem.com 我的虚拟服务器是带有IIS 8的Windows Server 2012,域名是https://kajsystem.com
I would suggest using IIS 8 configurations including using the URL Rewrite module, which can handle forwarding and retain the entire requested URL. 我建议使用IIS 8配置,包括使用URL Rewrite模块,它可以处理转发并保留整个请求的URL。 There is a fairly comprehensive article on MSDN site covering this:
MSDN网站上有一篇相当全面的文章,内容如下:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.