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:
hartvig
2010-10-25 12:09:38 +00:00
parent 174bc41560
commit 3861ecf41d
3 changed files with 33 additions and 0 deletions

View File

@@ -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="&quot;"></char>

View File

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

View File

@@ -564,6 +564,8 @@ namespace umbraco
else
{
tempUrl = baseUrl + tempUrl;
if (UmbracoSettings.AddTrailingSlash)
tempUrl += "/";
}
return tempUrl;
}