【问题标题】:How can I redirect IIS request to a specific url如何将 IIS 请求重定向到特定的 url
【发布时间】:2020-06-04 07:16:28
【问题描述】:

我们有一个应用程序 (http://stellramapps.com/) 在 server1 中运行,现在该应用程序已迁移到 server2。 我们已经完成了请求到 server1 以路由到 server2 的 DNS 设置。 IIS 重定向规则也已使用正则表达式 = ^http://stellramapps 设置为重定向到http://tdstest/ 但我仍然面临以下错误
无法访问此页面

•确保http://stellramapps.com 的网址正确

【问题讨论】:

标签: windows iis deployment


【解决方案1】:

http:// 不包含在 HTTP_HOST 中,因此请尝试使用 ^stellramapps$ 而不是 ^http://stellramapps

请确保 http://tdstest/ 可以从 stellramapps 的服务器访问。

那么请安装 URL rewrite 和 ARR

https://www.iis.net/downloads/microsoft/application-request-routing

最后可以启用IIS管理器->服务器节点->应用请求路由缓存->服务器代理设置->启用代理并应用此规则

   <rule name="redirect rule" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTP_HOST}" pattern="^stellramapps$" />
                    </conditions>
                    <action type="Redirect" url="http://tdstest/{R:0}" />
                </rule>

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2018-05-29
  • 1970-01-01
  • 2021-11-25
  • 1970-01-01
  • 2021-07-12
  • 1970-01-01
  • 2014-12-28
  • 1970-01-01
相关资源
最近更新 更多