I have created a web site in MVC 4 and am using URL Rewrite to host the application under another site. The problem I am having is that using the tilde (~) is causing the urls to be created by including the virtual directory. Below is my rule and sample links showing my desired link and my actual link:
<rule name="mysite.com" stopProcessing="true"><match url=".*" /><conditions><add input="{HTTP_HOST}" pattern="^(www.)?dev.mysite.com$" /><add input="{PATH_INFO}" pattern="^/dev.mysite.com/$" negate="true" /></conditions><action type="Rewrite" url="\dev.mysite.com\{R:0}" /></rule>
Desired:
<link href="/Content/themes/base/css?v=ps9G...tyus1" rel="stylesheet"/>
What I get:
<link href="/dev.mysite.com/Content/themes/base/css?v=ps9G...tyus1" rel="stylesheet"/>