gpt4 book ai didi

iis-7.5 - 将子域 URL 重定向到 IIS 中的另一个子域

转载 作者:行者123 更新时间:2023-12-04 06:37:20 27 4
gpt4 key购买 nike

我需要将“假”子域重定向到 IIS 7.5 中的真实子域。原因是营销部门不想在打印件中使用实际的网站地址。

实际网站网址:

报告.usapartners.com

营销部要
report.usapartners.com(假)到重定向到 报告.usapartners.com(真实)

同样,report.usapartners.com 不存在,只有 reporting.usapartners.com 存在

这是我尝试过的

我在 IIS 中为站点 reporting.usapartners.com 添加了一个绑定(bind)。我添加了 report.usapartners.com 作为主机名并使用了 reporting.usapartners.com IP 地址

然后我进入了reporting.usapartners.com web.config 并添加了这个:

<rewrite>
<rules>
<rule name="report" stopProcessing="true">
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="report.usapartners.com" negate="false" />
</conditions>
<action type="Redirect" url="http://reporting.usapartners.com" appendQueryString="false" redirectType="Permanent" />
</rule>
</rules>
</rewrite>

看起来我的解决方案创建了一个无法重定向到的别名。

我是否正确地解决了这个问题?似乎它应该是一个简单的问题来解决,但也许不是?欢迎和赞赏任何想法。

谢谢

最佳答案

我认为您需要为 report.usapartners.com 创建一个带有主机绑定(bind)的单独站点(假网站)在 IIS 中。这将是一个 stub 站点(它仍然需要磁盘上的路径,但它只会有一个 web.config 在那里),它将只托管一个重定向规则。

现在点击HTTP Redirect对于 IIS 中的该站点并勾选 Redirect requests to this destination并把 http://reporting.usapartners.com在文本框中。然后勾选Redirect all requests to exact destination (instead of relative to destination) ,不要勾选下一项然后选择状态码Permanent (301) .

如果您希望它重定向并保留子目录和/或查询字符串,那么您可以将文本框的内容更改为 http://reporting.usapartners.com$S$Q .请注意,在这种情况下没有尾部斜杠。 $S保留子目录和 $Q保留查询字符串。

关于iis-7.5 - 将子域 URL 重定向到 IIS 中的另一个子域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25082219/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com