I'm using the URL Rewrite feature in IIS7. I have set up a website on port 80 with some URL rewrite rules.
The first rule needs to point to a web application on port 8090 and the other rule needs to point to a web application on port 8091.
The rules need to be configured so that:
http://localhost/
rewrites tohttp://localhost:8090
http://localhost/test
rewrites tohttp://localhost:8091
.
Here is the rules that I'm using:
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="Site2" enabled="true" stopProcessing="true">
<match url="^.*/test/.*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="http://{HTTP_HOST}:8091/{R:0}" />
</rule>
<rule name="Site1" enabled="true" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="http://{HTTP_HOST}:8090/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
I'll mention that the "Site1" rule is working. If I go to http://localhost/
, I am presented with the web application hosted on port 8090. If I go to http://localhost/test
, I am presented with a 404 error.