这是我部署的内容:

testRedirect是一个空网站。所有子应用程序都是在应用程序中转换的子文件夹。它们都是 ASP .Net MVC 站点。
这是我要设置的内容:
Http://localhost/必须在地址栏中SiteName1显示不显示的内容Http://localhost/SiteName1/(必须保持Http://localhost/)Http://localhost/SiteName1/必须在地址栏中SiteName1显示不显示的内容Http://localhost/SiteName1/(必须保持Http://localhost/)Http://localhost/SiteName2/显示地址栏中的内容SiteName2和显示( &和任何其他网站的行为相同......)Http://localhost/SiteName2/SiteName3SiteName4
换句话说,我希望我SiteName1的行为像一个主页
到目前为止,我尝试过的与@cheesemacfly在这里提供的答案类似:
<rules>
<rule name="Redirect if SiteName1" stopProcessing="true">
<match url="^SiteName1/(.*)$" />
<action type="Redirect" url="{R:1}" />
</rule>
<rule name="Rewrite to sub folder">
<match url="^.*$" />
<action type="Rewrite" url="SiteName1/{R:0}" />
</rule>
</rules>
它适用于案例 1 和 2,但不适用于其他案例。
我试图添加这样的规则,但它没有成功......
<rule name="if_not_SiteName1" stopProcessing="true">
<match url="^SiteName1/(.*)$" negate="true" />
<action type="None" />
</rule>