Deselecting the profile page in in site settings, or deleting the profile page (activity feed) page cause different URL redirect/rewrite behaviour.
When a profile page is selected, it is possible to navigate to:
/my-page/something-this-is-not-a-subpage
When no profile page is selected
/my-page/something-this-is-not-a-subpage redirects (301) to
/my-page
or
/my-page/qsdf
/my-page
This was described here: https://dnntracker.atlassian.net/browse/DNN-5864?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
But was set to "could not reproduce". However the OP did find the cause, see thread.
However I could perfectly reproduce this on DNN 9.4 AND 8.4
List the precise steps to reproduce the bug:
/Contact/qsdf redirects to /Contact
/Contact/qsdf stays like it is
When setting a Profile page again (this can be any dummy page, even with no-view rights), the undesired redirect doesn't happen.
Regardless of what should happen (preferably nothing), This profile setting should not affect all other URLs.
The important part about that linked ticket is this:
I would like to leave a comment because I found the same issue yesterday.
It worked well before but suddenly not from yesterday.I thought I didn't change anything that could cause this issue, but in fact I was wrong.
After I debug the code I find the reason.
I changed Admin -> Site-Settings -> Advanced Settings - > User Profile Page to 'None Specified', and it caused this issue.
The code block related is: DotNetNuke.dll -> TabIndexController.cs
if (thisPortal != null && (thisPortal.UserTabId == tab.TabID || thisPortal.UserTabId == tab.ParentId || thisPortal.UserTabId == -1))
{
//user profile action specified. If tabid match for this tab, add a do301 check because we want to make
//sure that the trimmed Url is used when appropriate
rewritePath = RedirectTokens.AddRedirectReasonToRewritePath(rewritePath,
ActionType.CheckFor301,
RedirectReason.User_Profile_Url);
}
Because thisPortal.UserTabId is -1, so trimmed Url is used for every page.
It works again after I change to specific the User Profile Page.
Hope this comment can help you.
So I guess the correction here would be to check if the thisPortal.UserTabId == -1 and react accordingly.
Most helpful comment
The important part about that linked ticket is this:
So I guess the correction here would be to check if the thisPortal.UserTabId == -1 and react accordingly.