我遇到了web.config和强制SSL的问题。我有一个重写URL的规则,因为Nette PHP站点是托管的。
<rule name="Rewrite Admin" stopProcessing="true">
<match url="^admin/(.*)" ignoreCase="true"/>
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/admin/index.php" />
</rule>
如果我在网址中使用 https ,请求始终会重定向到http。 (https://example.com/admin - &gt; example.com/admin)。当我在下面对所有请求使用SSL强制规则时,会发生错误(重定向太多)。 (在web.config中有2个规则)
<rule name="Redirect to https">
<match url="(.*)"/>
<conditions>
<add input="{HTTPS}" pattern="Off"/>
<add input="{REQUEST_METHOD}" pattern="^get$|^head$" />
<add input="{REQUEST_URI}" pattern="^/(node)" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(cbre)" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}"/>
</rule>
如何强制ssl为动作类型“重写”?
感谢您的帮助