Here's what I have deployed:
testRedirect
is an empty website. All sub-applications are sub-folders that have been converted in application. All of them are ASP .Net MVC sites.
Here's what I want to setup:
Http://localhost/
must show the content ofSiteName1
without displayingHttp://localhost/SiteName1/
in the adress bar (it must stayHttp://localhost/
)Http://localhost/SiteName1/
must show the content ofSiteName1
without displayingHttp://localhost/SiteName1/
in the adress bar (it must stayHttp://localhost/
)Http://localhost/SiteName2/
shows the content ofSiteName2
and displaysHttp://localhost/SiteName2/
in the adress bar (Same behavior forSiteName3
&SiteName4
and any other sites....)
In other words, I want my SiteName1
to act like a home site
What I've tried so far, is something similar to the answer provided by @cheesemacfly here:
<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>
It works great for Case1 & 2 but not the other ones.
I tried to add rules like this one, but it was not successful...
<rule name="if_not_SiteName1" stopProcessing="true">
<match url="^SiteName1/(.*)$" negate="true" />
<action type="None" />
</rule>