From e3efc0d19ba0f075608cc822be7d1bfa4e106c2a Mon Sep 17 00:00:00 2001 From: Stephan Date: Fri, 16 Nov 2012 15:52:14 -0100 Subject: [PATCH] U4-1194 - Mvc templates do not work when running in a virtual directory --- src/Umbraco.Web/UmbracoModule.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs index cad2639599..bc021fc761 100644 --- a/src/Umbraco.Web/UmbracoModule.cs +++ b/src/Umbraco.Web/UmbracoModule.cs @@ -319,11 +319,8 @@ namespace Umbraco.Web switch (engine) { case RenderingEngine.Mvc: - //the Path is normally ~/umbraco but we need to remove the start ~/ of it and if someone modifies this - //then we should be rendering the MVC stuff in that location. - rewritePath = "~/" - + GlobalSettings.Path.TrimStart(new[] { '~', '/' }).TrimEnd(new[] { '/' }) - + "/RenderMvc"; + // GlobalSettings.Path has already been through IOHelper.ResolveUrl() so it begins with / and vdir (if any) + rewritePath = GlobalSettings.Path.TrimEnd(new[] { '/' }) + "/RenderMvc"; // we rewrite the path to the path of the handler (i.e. default.aspx or /umbraco/RenderMvc ) context.RewritePath(rewritePath, "", currentQuery.TrimStart(new[] { '?' }), false);