I am using IIS URL Rewrite 2.0 module to create a URL that always points to the latest version of my app. I have configured it as follows:
<rule name="Latest" stopProcessing="true">
<match url="^latest(.*)" />
<action type="Rewrite" url="1.1{R:1}" />
</rule>
The intention is that if something goes to /latest/*
then all of the URLs are rewritten as /1.1/*
. For example /latest/index.html
should become /1.1/index.html
.
This is working when I request a file, for example:
/latest/index.html - works
/latest/js/app.js - works
However this does not work:
/latest
Since index.html
is the default document, I would expect this to rewrite to /1.1/index.html
, but in fact it seems to do a redirect. For example, if I type the following in the browser address bar:
http://<domain>/latest
and press ENTER, it changes to:
http://<domain>/1.1
as if redirected. It still works, but I don't want the URL to change (hence why I'm using Rewrite
rather than Redirect
). Any idea why? Is there something wrong my rule?