goal
Using IIS 7.5 and the URL module Rewrite 2.0, I want to rewrite the relative path "/ myapp" to "/ myapp-public" without redirecting the browser.
What i 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 server-side URL, IIS responds with β301 Moved Permanentently,β which redirects the user to β/ myapp-publicβ. It behaves as if I used an action such as "Redirection" instead of "Overwrite".
Does anyone know why the Rewrite action will perform a redirect? Any thoughts on how to debug this question further? Thanks!
source share