Quantcast
Channel: Off-Topic Posts (Do Not Post Here) forum
Viewing all articles
Browse latest Browse all 14169

MVC 4, IIS 7, URL Rewrite. The virtual directory is being added to the beginning of my links

$
0
0

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"/>

Viewing all articles
Browse latest Browse all 14169

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>