From c52e6c4fb1f3f9846867239a0ce1e5cff9af6ab6 Mon Sep 17 00:00:00 2001 From: Charles Nurse Date: Wed, 11 Sep 2013 14:58:03 -0700 Subject: [PATCH] DNN-3565 Vanity URLs break "Messages" & "Notifications" Links --- .../Entities/Urls/RewriteController.cs | 2 +- .../UrlRewrite/VanityUrl/TestFile.csv | 21 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/DNN Platform/Library/Entities/Urls/RewriteController.cs b/DNN Platform/Library/Entities/Urls/RewriteController.cs index 4639b23f7d1..e8f6faf031a 100644 --- a/DNN Platform/Library/Entities/Urls/RewriteController.cs +++ b/DNN Platform/Library/Entities/Urls/RewriteController.cs @@ -361,7 +361,7 @@ private static bool CheckTabPath(string tabKeyVal, UrlAction result, FriendlyUrl string prefix = urlSegments[0]; - if (prefix == settings.VanityUrlPrefix && urlSegments.Length == 2) + if (prefix == settings.VanityUrlPrefix && urlSegments.Length > 1) { string vanityUrl = urlSegments[1]; diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Urls/TestFiles/UrlRewrite/VanityUrl/TestFile.csv b/DNN Platform/Tests/DotNetNuke.Tests.Urls/TestFiles/UrlRewrite/VanityUrl/TestFile.csv index 30805f20670..9ae734127e1 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Urls/TestFiles/UrlRewrite/VanityUrl/TestFile.csv +++ b/DNN Platform/Tests/DotNetNuke.Tests.Urls/TestFiles/UrlRewrite/VanityUrl/TestFile.csv @@ -1,18 +1,17 @@ Test, UserName, RedirectOldProfileUrl, VanityUrl, Scheme, Page Name, Test Url, Expected Url, Status, Final Url, RedirectReason -Bad Vanity Url, test, , , http://, Home, http://{alias}/baduser, {defaultPage}?TabId={tabId}, 301, http://{alias}/, Deleted_Page -Vanity Url, test, , testuser, http://, Activity Feed, http://{alias}/{vanityUrl}, {defaultPage}?TabId={tabId}&UserId={userId}, 200 -Vanity Url Child, test, , testuser, http://, Messages, http://{alias}/{vanityUrl}/Messages, {defaultPage}?TabId={tabId}&UserId={userId}, 200 -Vanity Url Profile, test, , testuser, http://, Activity Feed, http://{alias}/{vanityUrl}/ctl/Profile/pageno/1, {defaultPage}?TabId={tabId}&UserId={userId}&ctl=Profile&pageno=1, 200 -Alias Includes Vanity Url, test, , child, http://, Activity Feed, http://{alias}/{vanityUrl}, {defaultPage}?TabId={tabId}&UserId={userId}, 200 +Bad Vanity Url, test, , , http://, Home, http://{alias}/users/baduser, {defaultPage}?TabId={tabId}, 301, http://{alias}/, Deleted_Page +Vanity Url, test, , testuser, http://, Activity Feed, http://{alias}/users/{vanityUrl}, {defaultPage}?TabId={tabId}&UserId={userId}, 200 +Vanity Url Child, test, , testuser, http://, Messages, http://{alias}/users/{vanityUrl}/Messages, {defaultPage}?TabId={tabId}&UserId={userId}, 200 +Vanity Url Profile, test, , testuser, http://, Activity Feed, http://{alias}/users/{vanityUrl}/ctl/Profile/pageno/1, {defaultPage}?TabId={tabId}&UserId={userId}&ctl=Profile&pageno=1, 200 Old Url No Vanity Url Default, test, , , http://, Activity Feed, http://{alias}/Activity-Feed/UserId/{userId}, {defaultPage}?TabId={tabId}&UserId={userId}, 200 -Old Url Vanity Url Default, test, , testuser, http://, Activity Feed, http://{alias}/Activity-Feed/UserId/{userId}, {defaultPage}?TabId={tabId}&UserId={userId}, 301, http://{alias}/{vanityUrl}, Unfriendly_Url_2 -Old Url Vanity Url Child Default, test, , testuser, http://, Messages, http://{alias}/Activity-Feed/Messages/UserId/{userId}, {defaultPage}?TabId={tabId}&UserId={userId}, 301, http://{alias}/{vanityUrl}/Messages, Unfriendly_Url_2 -Old Url Vanity Url Profile Default, test, , testuser, http://, Activity Feed, http://{alias}/Activity-Feed//UserId/{userId}/ctl/Profile/pageno/1, {defaultPage}?TabId={tabId}&UserId={userId}&ctl=Profile&pageno=1, 301, http://{alias}/{vanityUrl}/ctl/Profile/pageno/1, Unfriendly_Url_2 +Old Url Vanity Url Default, test, , testuser, http://, Activity Feed, http://{alias}/Activity-Feed/UserId/{userId}, {defaultPage}?TabId={tabId}&UserId={userId}, 301, http://{alias}/users/{vanityUrl}, Unfriendly_Url_2 +Old Url Vanity Url Child Default, test, , testuser, http://, Messages, http://{alias}/Activity-Feed/Messages/UserId/{userId}, {defaultPage}?TabId={tabId}&UserId={userId}, 301, http://{alias}/users/{vanityUrl}/Messages, Unfriendly_Url_2 +Old Url Vanity Url Profile Default, test, , testuser, http://, Activity Feed, http://{alias}/Activity-Feed//UserId/{userId}/ctl/Profile/pageno/1, {defaultPage}?TabId={tabId}&UserId={userId}&ctl=Profile&pageno=1, 301, http://{alias}/users/{vanityUrl}/ctl/Profile/pageno/1, Unfriendly_Url_2 Old Url No Vanity Url false, test, false, , http://, Activity Feed, http://{alias}/Activity-Feed/UserId/{userId}, {defaultPage}?TabId={tabId}&UserId={userId}, 200 Old Url Vanity Url false, test, false, testuser, http://, Activity Feed, http://{alias}/Activity-Feed/UserId/{userId}, {defaultPage}?TabId={tabId}&UserId={userId}, 200 Old Url Vanity Url Child false, test, false, testuser, http://, Messages, http://{alias}/Activity-Feed/Messages/UserId/{userId}, {defaultPage}?TabId={tabId}&UserId={userId}, 200 Old Url Vanity Url Profile false, test, false, testuser, http://, Activity Feed, http://{alias}/Activity-Feed//UserId/{userId}/ctl/Profile/pageno/1, {defaultPage}?TabId={tabId}&UserId={userId}&ctl=Profile&pageno=1, 200 Old Url No Vanity Url true, test, true, , http://, Activity Feed, http://{alias}/Activity-Feed/UserId/{userId}, {defaultPage}?TabId={tabId}&UserId={userId}, 200 -Old Url Vanity Url true, test, true, testuser, http://, Activity Feed, http://{alias}/Activity-Feed/UserId/{userId}, {defaultPage}?TabId={tabId}&UserId={userId}, 301, http://{alias}/{vanityUrl}, Unfriendly_Url_2 -Old Url Vanity Url Child true, test, true, testuser, http://, Messages, http://{alias}/Activity-Feed/Messages/UserId/{userId}, {defaultPage}?TabId={tabId}&UserId={userId}, 301, http://{alias}/{vanityUrl}/Messages, Unfriendly_Url_2 -Old Url Vanity Url Profile true, test, true, testuser, http://, Activity Feed, http://{alias}/Activity-Feed//UserId/{userId}/ctl/Profile/pageno/1, {defaultPage}?TabId={tabId}&UserId={userId}&ctl=Profile&pageno=1, 301, http://{alias}/{vanityUrl}/ctl/Profile/pageno/1, Unfriendly_Url_2 \ No newline at end of file +Old Url Vanity Url true, test, true, testuser, http://, Activity Feed, http://{alias}/Activity-Feed/UserId/{userId}, {defaultPage}?TabId={tabId}&UserId={userId}, 301, http://{alias}/users/{vanityUrl}, Unfriendly_Url_2 +Old Url Vanity Url Child true, test, true, testuser, http://, Messages, http://{alias}/Activity-Feed/Messages/UserId/{userId}, {defaultPage}?TabId={tabId}&UserId={userId}, 301, http://{alias}/users/{vanityUrl}/Messages, Unfriendly_Url_2 +Old Url Vanity Url Profile true, test, true, testuser, http://, Activity Feed, http://{alias}/Activity-Feed//UserId/{userId}/ctl/Profile/pageno/1, {defaultPage}?TabId={tabId}&UserId={userId}&ctl=Profile&pageno=1, 301, http://{alias}/users/{vanityUrl}/ctl/Profile/pageno/1, Unfriendly_Url_2 \ No newline at end of file