http到https重定向-iis8.5 url重写2.0重定向规则不起作用
我很难让下面的重定向规则正常工作http到https重定向-iis8.5 url重写2.0重定向规则不起作用,iis,url-rewriting,url-redirection,iis-8.5,Iis,Url Rewriting,Url Redirection,Iis 8.5,我很难让下面的重定向规则正常工作 <rules> <rule name="Relative Path Rewrite" stopProcessing="false"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<rules>
<rule name="Relative Path Rewrite" stopProcessing="false">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/$" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
<rule name="Ssl Redirect" stopProcessing="false">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
它重定向到“没问题”
但是,如果我输入,它将重定向到而不是,我无法找出原因?它似乎忽略了来自我的匹配的{R:1}返回引用,该引用应该是“faq”
我已经为此奋斗了一段时间,任何关于这里发生的事情的想法都会很好
另外一些信息是,我正在托管一个angular 4.0站点,此规则适用于…反转规则
<rewrite>
<rules>
<rule name="Ssl Redirect" stopProcessing="false">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
<rule name="Relative Path Rewrite" stopProcessing="false">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/$" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
此规则导致的问题相对路径重写
。此规则中的条件:重定向所有内容,不是文件
或目录
,URL不是/
。此规则正在从http://mywebsite.com/faq
它正在重定向到http://mywebsite.com
然后从http://mywebsite.com
至https://mywebsite.com