IIS-重定向到带掩码的子文件夹

IIS-重定向到带掩码的子文件夹,iis,url-rewriting,http-redirect,Iis,Url Rewriting,Http Redirect,我正在使用iis10。我有一个网站,只能通过HTTPS协议通过subdomain1.domain.com和subdomain2.domain.com访问 仅当请求来自subdomain2.domain.com网站应加载URLsubdomain2.domain.com/la/signin时,我想设置一个重写规则。最后一个URL应该被屏蔽,而不是显示给用户 我尝试了很多重写规则,并搜索了关于stackoverflow的其他建议,但每一个解决方案都不适合我,即使没有掩码 这只是我最后一次尝试不戴口罩,

我正在使用iis10。我有一个网站,只能通过HTTPS协议通过
subdomain1.domain.com
subdomain2.domain.com
访问

仅当请求来自
subdomain2.domain.com
网站应加载URL
subdomain2.domain.com/la/signin
时,我想设置一个重写规则。最后一个URL应该被屏蔽,而不是显示给用户

我尝试了很多重写规则,并搜索了关于stackoverflow的其他建议,但每一个解决方案都不适合我,即使没有掩码

这只是我最后一次尝试不戴口罩,但我尝试了许多其他解决方案:

<rewrite>
    <rules>
       <rule name="Redirect" stopProcessing="true">
          <match url="https://subdomain2\.domain\.com$" />
          <action type="Rewrite" url="{R:0}/la/signin" appendQueryString="true" logRewrittenUrl="true" />
       </rule>
    </rules>
</rewrite>


还有其他建议吗?

请试试这个规则。它将重写为subdomain2.domain.com/la/signin

<rule name="Redirect" stopProcessing="true">
          <match url="(.*)" />
          <action type="Rewrite" url="la/signin" appendQueryString="true" logRewrittenUrl="true" />
                    <conditions>
                        <add input="{HTTP_HOST}" pattern="subdomain2\.domain\.com" />
                        <add input="{HTTPS}" pattern="^on$" />
                        <add input="{URL}" pattern="^(/)?$" />
                    </conditions>
       </rule>


在我的例子中,这条规则完全被忽略了。它不断打开subdomain2.domain.com/signin页面(实际存在)。应用程序是用Angular创建的,你认为Angular路由可能涉及到这一点吗?我记得IIS中的Angular主机也依赖于URL重写,所以它不应该忽略规则。你们修改订单了吗?只需将其置于其他重写规则之上。是的,我删除了其他规则。请启用失败的请求跟踪,并检查是否忽略了您的规则。