Goal
Using IIS 7.5 and the URL Rewrite 2.0 module, I want to rewrite the relative path "/myapp" to "/myapp-public", without a browser redirection.
What I've tried
I placed the following web.config file in wwwroot:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
</system.web>
<system.webServer>
<rewrite>
<rules>
<rule name="Rewrite to public" stopProcessing="true">
<match url="^myapp" />
<action type="Rewrite" url="/myapp-public" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Problem
Instead of rewriting the URL on the server side, IIS responds with a "301 Moved Permanently" which redirects the user to "/myapp-public". It is behaving as if I had used an action of type "Redirect" instead of "Rewrite".
Does anyone know why a "Rewrite" action would perform a redirect instead? Any thoughts on how to debug this issue further? Thanks!