Url.Content throws exception when UrlRewrite module is installed and using ~(tilde) in passed parameter
<p>The problem is:</p>

<ol>
<li>I have installed <code>UrlRewrite</code> modole on my IIS for <strong>"A"</strong> website</li>
<li><p>I have <strong>"B"</strong> web site (MVC 5.0) which doesn't use 'UrlRewrite' module but get exception when calling <code>UrlHelper.Content("~/blobl/foo/bar")</code>. 
The exception is because of using <code>UrlRewriter</code> module and using <code>~</code> character for function parameter at same time.
The exception is: </p>

<p>System.ArgumentException: Value does not fall within the expected range.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Web.Hosting.IIS7WorkerRequest.GetServerVariableInternal(String name)
at System.Web.WebPages.UrlRewriterHelper.WasThisRequestRewritten(HttpContextBase httpContext)
at System.Web.WebPages.UrlUtil.GenerateClientUrlInternal(HttpContextBase httpContext, String contentPath)
at System.Web.WebPages.UrlUtil.GenerateClientUrlInternal(HttpContextBase httpContext, String contentPath)
at System.Web.WebPages.UrlUtil.GenerateClientUrl(HttpContextBase httpContext, String contentPath)</p></li>
</ol>

<p>If I uninstall <code>UrlRewrite</code> module, everything will be OK but the <strong>"A"</strong> website encounters problem. Also, I couldn't find any way to disable this module only for a website. </p>

<p>NOTE: I've checked <a href="https://stackoverflow.com/questions/18505776/iis-url-rewrite-module-url-content-does-not-resolve-css-image-path-properly">IIS URL Rewrite module: Url.Content() does not resolve CSS/Image path properly</a> but I don't want to change the source code.</p>