Pet*_*ter 5 https url-rewriting iis-7.5
我正在尝试在 IIS 7.5 中重写 URL 以重定向到“单页”的 HTTPS。域的其余部分应保留 HTTP。
为此,我正在编辑我的 Web.config 文件。有人可以告诉我我在以下规则中做错了什么:
<system.webServer>
<rewrite>
<rules>
<rule name="SpecificRedirect" stopProcessing="true">
<match url="^register.aspx$" />
<action type="Redirect" url="https://mail.domain.org/register.aspx" />
</rule>
</rules>
</rewrite>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
下面是我的 URL 重写模块在 IIS 7.5 中的样子

非常感谢。
我认为你非常接近,但你的重定向会导致无限循环。尝试这个:
<rule name="SpecificRedirect" stopProcessing="true">
<match url="^register.aspx$" />
<conditions>
<add input="{HTTPS}" pattern="^off$" />
</conditions>
<action type="Redirect" url="https://mail.domain.org/register.aspx" />
</rule>
Run Code Online (Sandbox Code Playgroud)
让我知道如果您必须处理多个域,那么规则将需要更复杂的重写 url。
编辑:显然我们需要重定向而不是重写:)
| 归档时间: |
|
| 查看次数: |
15277 次 |
| 最近记录: |