Fix not redirecting to primary alias when tab-specific alias exists #3832
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Redirects to default portal alias failed when custom tab alias was used.
Details
In
AdvancedUrlRewriter
, there already was a check to see if the current alias was a custom tab alias for any tab, but there was no check to see if the alias actually is a custom alias for the request tab. That's what has been added.In the process, it turned out that stored procedure
GetTabCustomAliases
was not covering all use cases, so that needed a change too.I have a site with 3 aliases:
bli
is the default and the site is set to redirect. This works in 9.6.1Then I created a page
/zzz
and gave it a custom url of/z
on aliasble.40fdev.me
Now, the site is not redirecting from
ble.40fdev.me
tobli.40feev.me
anymore, because there is a custom tab alias.With the fix applied,
ble.40fdev.me
is redirected tobli
, except forble.40fdev.me/zzz
Fixes #2841