U4-1194 - Mvc templates do not work when running in a virtual directory

This commit is contained in:
Stephan
2012-11-16 15:52:14 -01:00
parent 3ba9e09164
commit e3efc0d19b

View File

@@ -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);