Fixes 19818 and implements 29257. Issues with NiceUrl and NEW configuration option to add trailing slash to urls
[TFS Changeset #78909]
This commit is contained in:
@@ -73,6 +73,8 @@
|
||||
<requestHandler>
|
||||
<!-- this will ensure that urls are unique when running with multiple root nodes -->
|
||||
<useDomainPrefixes>false</useDomainPrefixes>
|
||||
<!-- this will add a trailing slash (/) to urls when in directory url mode -->
|
||||
<addTrailingSlash>true</addTrailingSlash>
|
||||
<urlReplacing removeDoubleDashes="true">
|
||||
<char org=" ">-</char>
|
||||
<char org="""></char>
|
||||
|
||||
@@ -229,6 +229,35 @@ namespace umbraco
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether umbraco will use ASP.NET MasterPages for rendering instead of its propriatary templating system.
|
||||
/// </summary>
|
||||
|
||||
@@ -564,6 +564,8 @@ namespace umbraco
|
||||
else
|
||||
{
|
||||
tempUrl = baseUrl + tempUrl;
|
||||
if (UmbracoSettings.AddTrailingSlash)
|
||||
tempUrl += "/";
|
||||
}
|
||||
return tempUrl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user