Redirects that come to the site end up in 404
Problem/Motivation
URLs where a specific version is present as the last path segment are redirecting to a page that appends (not replaces) `11.x` as the last path segment. Which results in a 404 because there are 2 versions in the path.
For example, this URL:
Redirects to an 11.x search page, with the following message:
Sorry, api/drupal/core%21lib%21Drupal%21Component%21Utility%21Unicode.php/function/Unicode%3A%3Astrlen/8.5.x/11.x cannot be found.
(Notice the “8.5.x/11.x” at the end of the url in the message.)
Proposed resolution
Figure out the object and look for that in the latest or closest (if possible) version.
Related issue: Issue #3444958
Related issue: Issue #3342815
Edited by drupalbot