Amended as per PR comments to support replacement of no nodes functionality via customising the route table.

This commit is contained in:
Andy Butland
2020-03-02 17:17:14 +01:00
parent e6a55a215a
commit 5fb23951cf
3 changed files with 9 additions and 6 deletions

View File

@@ -241,8 +241,10 @@ namespace Umbraco.Web
_logger.Warn<UmbracoModule>("Umbraco has no content");
var rewriteTo = _uriUtility.ToAbsolute(_globalSettings.UmbracoPath + Constants.Web.NoContentRoute);
httpContext.RewritePath(_uriUtility.ToAbsolute(rewriteTo));
if (RouteTable.Routes[Constants.Web.NoContentRouteName] is Route route)
{
httpContext.RewritePath(route.Url);
}
return false;
}