I am rewriting the url http://www.tworiverstaines.co.uk to http://www.tworiverstaines.co.uk/TwoRivers/ using this rule:
<rule name="tworiverstaines.co.uk" stopProcessing="false">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{PATH_INFO}" negate="true" pattern="^.?TwoRivers/.*" />
<add input="{HTTP_HOST}" pattern="^www.tworiverstaines.co.uk$" />
</conditions>
<action type="Rewrite" url="TwoRivers/{PATH_INFO}" />
</rule>
I am using the tilde ~ in all the relative links for my web controls.
When I navigate to http://www.tworiverstaines.co.uk/ all the paths in the default document are:
href="Filename.aspx" which is what I want.
When I navigate directly to the file http://www.tworiverstaines.co.uk/Default.aspx all the paths are: href="TwoRivers/Filename.aspx" which results in the subfolder being shown in the browser address bar when clicking this link, which I do not want.
Does anyone know why the paths change?