IIS-基于入站URL的不同默认页面

发布于 2025-02-01 04:40:05 字数 244 浏览 3 评论 0原文

您好,我的目标是让用户根据入站URL登陆我域上的不同页面。这是托管的IIS 10.0。

例如,

  • test.mydomain.com将降落在mydomain.com/test/version5/test.htm
  • production.mydomain.com将降落在mydomain.com/production.htm

不确定最好的方法。我应该弄乱DNS,重定向还是在IIS中操纵它?

Hello my goal is to have users land on different pages on my domain based on the inbound url. This is IIS 10.0 hosted.

For example

  • test.mydomain.com would land at mydomain.com/test/version5/test.htm
  • production.mydomain.com would land at mydomain.com/production.htm

Not sure the best way to do this. Should I mess with DNS, a redirect, or is there some way to manipulate it in IIS?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽心 2025-02-08 04:40:05

您可以按照Lex Li的建议使用URL重写,这是最简单的方法,我为您提供了一个可以用作参考的示例,您的两个重定向没有任何共同点,因此您需要创建2个不同的规则。

<rule name="test1" stopProcessing="true">
   <match url=".*" />
     <conditions>
        <add input="{HTTP_HOST}" pattern="(.*)\.mydomain\.com" />
     </conditions>
   <action type="Redirect" url="mydomain.com/{C:1}/version5/test.htm" />
</rule>

<rule name="test2" stopProcessing="true">
   <match url=".*" />        
   <action type="Redirect" url="mydomain.com/production.htm" />
</rule>

You can use url rewrite as suggested by Lex Li, this is the easiest way, I made a example for you that you can use as a reference, your two redirects have nothing in common, so you need to create 2 different rules.

<rule name="test1" stopProcessing="true">
   <match url=".*" />
     <conditions>
        <add input="{HTTP_HOST}" pattern="(.*)\.mydomain\.com" />
     </conditions>
   <action type="Redirect" url="mydomain.com/{C:1}/version5/test.htm" />
</rule>

<rule name="test2" stopProcessing="true">
   <match url=".*" />        
   <action type="Redirect" url="mydomain.com/production.htm" />
</rule>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文