Redirect IIS重定向到HTTPS更改URL

Redirect IIS重定向到HTTPS更改URL,redirect,iis,Redirect,Iis,根据这篇文章,我试图在IIS中强制HTTPS重定向 奇怪的是,当我创建如下重定向URL时 https://{HTTP_HOST}/{REQUEST_URI} 我打开,而不是被重定向到我被重定向到 结尾的“h”字母是什么?为什么缺少“somePage”?这是将每个http链接重定向到其https版本的代码。 如果将其放在web配置中,它应该可以工作: <rule name="Redirect to www MAIN" stopProcessing="true"> <matc

根据这篇文章,我试图在IIS中强制HTTPS重定向

奇怪的是,当我创建如下重定向URL时

https://{HTTP_HOST}/{REQUEST_URI}
我打开,而不是被重定向到我被重定向到


结尾的“h”字母是什么?为什么缺少“somePage”?

这是将每个http链接重定向到其https版本的代码。 如果将其放在web配置中,它应该可以工作:

<rule name="Redirect to www MAIN"  stopProcessing="true">
 <match url=".*" />
<conditions logicalGrouping="MatchAny">
  <add input="{HTTP_HOST}" pattern="^yourdomain.com$" />
  <add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect"  url="https://www.yourdomain.com/{R:0}" redirectType="Permanent" />
 </rule>

选中?如果您使用任何nlb,也可以在那里进行配置。这样更干净