我正在尝试做一些非常简单的事情。 我只需要强制SSL,我正在尝试使用URl Rewrite插件。 当我将下面的规则放入我的conf时,我没有得到任何结果。
<rewrite> <rules> <rule name="Redirect to https" stopProcessing="true"> <match url="(.*)[^/])$" /> <conditions> <add input="{SERVER_PORT}" pattern="443" negate="true" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" /> </rule> </rules> </rewrite>
任何想法,为什么这不捕捉?
这是我在一个完整的工作网站上的规则 – 工作绝对正常 。 正如你所看到的,它与你所拥有的非常接近。
<rewrite> <rules> <clear /> <rule name="Redirect to https" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTPS}" pattern="off" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" /> </rule> </rules> </rewrite>
如果它不适用于你 – 那么你也有其他的东西(SSL没有configuration/错误configuration的SSL等)。 挖掘错误细节 – 应该说: