I am using the following rule to map a domain through to a subfolder in my shared hosting environment:
<rule name="mydomain.co.uk">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^www.mydomain.co.uk$" />
<add input="{HTTP_HOST}" pattern="^mydomain.co.uk$" />
</conditions>
<action type="Rewrite" url="MyDomainFolder/{PATH_INFO}" />
</rule>
This rule allows me to access my website at www.mydomain.co.uk instead of www.mydomain.co.uk/MyDomainFolder/.
The problem is the rule changes the virtual root of my application. A control with a href="PageTwo.aspx" becomes href="MyDomainFolder/PageTwo.aspx" this also the same when using the tilde: href="~/PageTwo.aspx" becomes href="MyDomainFolder/PageTwo.aspx"
For some reason this seems to prevent response.redirect from working?
Does anyone have any ideas how I can fix the links and response.redirect?