简单的IIS URL重写 [英] Simple IIS URL Rewrite
问题描述
简单的问题。我需要将特定子域URL上的所有http 80和https 443请求重定向到备用SSL端口https 444。
Simple question. I need to redirect all http 80 and https 443 requests on a specific subdomain URL to an alternative SSL port https 444.
示例: http://sub.corp.com - > https://sub.corp.com:444
示例: https://sub.corp .com - > https://sub.corp.com:444
Example: http://sub.corp.com --> https://sub.corp.com:444 Example: https://sub.corp.com --> https://sub.corp.com:444
我只想使用IIS 7.5 URL重写模块。
I only wish to use IIS 7.5 URL Rewrite module.
谢谢。
推荐答案
以下网址重写规则应该符合您的要求:
The following URL rewrite rule should do what you want:
<rewrite>
<rules>
<rule name="Redirect to port 444" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="^ON$" negate="true" />
<add input="{SERVER_PORT}" pattern="^444$" negate="true" />
</conditions>
<action type="Redirect" url="https://sub.corp.com:444/{R:0}" />
</rule>
</rules>
</rewrite>
重定向到 https://sub.corp.com:444 每当HTTPS未开启或端口号不是444时。该站点应绑定到端口80(带HTTP),443(带有用于标准的HTTPS(SSL)en 444(使用HTTPS)可以使其工作。
It redirects to https://sub.corp.com:444 whenever HTTPS is not ON or when the port number is not 444. The site should have bindings to port 80 (with HTTP), 443 (with HTTPS for standards SSL) en 444 (with HTTPS) for this to work.
这篇关于简单的IIS URL重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!