diff --git a/config templates/config/umbracoSettings.config b/config templates/config/umbracoSettings.config index 030d64bcfa..a64f3c6b50 100644 --- a/config templates/config/umbracoSettings.config +++ b/config templates/config/umbracoSettings.config @@ -73,6 +73,8 @@ false + + true - diff --git a/umbraco/businesslogic/UmbracoSettings.cs b/umbraco/businesslogic/UmbracoSettings.cs index 4df3d5f30c..6f5d1f0688 100644 --- a/umbraco/businesslogic/UmbracoSettings.cs +++ b/umbraco/businesslogic/UmbracoSettings.cs @@ -229,6 +229,35 @@ namespace umbraco } } + /// + /// This will add a trailing slash (/) to urls when in directory url mode + /// NOTICE: This will always return false if Directory Urls in not active + /// + public static bool AddTrailingSlash + { + get + { + try + { + if (GlobalSettings.UseDirectoryUrls) + { + bool result; + if (bool.TryParse(GetKey("/settings/requestHandler/addTrailingSlash"), out result)) + return result; + return false; + } + else + { + return false; + } + } + catch + { + return false; + } + } + } + /// /// Gets a value indicating whether umbraco will use ASP.NET MasterPages for rendering instead of its propriatary templating system. /// diff --git a/umbraco/presentation/library.cs b/umbraco/presentation/library.cs index 3bdd530eb2..b5ed0a2623 100644 --- a/umbraco/presentation/library.cs +++ b/umbraco/presentation/library.cs @@ -564,6 +564,8 @@ namespace umbraco else { tempUrl = baseUrl + tempUrl; + if (UmbracoSettings.AddTrailingSlash) + tempUrl += "/"; } return tempUrl; }