Reputation: 181
I have a C# MVC application hosted on apps.server.com/appname but I have a URL rewrite being done on my company's F5 that makes that application visible to www.server.com/apps/appname. Now when I navigate to that url no images or links work because they are all pointing to www.server.com/appname when using @Url.Content("~/URL"). What do I need to do for all of my helper classes to know that I am under an aliased URL instead of where it thinks it is (ie, the apps.server.com URL)?
Upvotes: 1
Views: 953
Reputation: 1038740
If you are running in IIS 7 Integrated Pipeline mode try putting the following in your Global.asax
:
protected void Application_BeginRequest(object sender, EventArgs e)
{
Request.ServerVariables.Remove("IIS_WasUrlRewritten");
}
Upvotes: 1