The feature implementend in https://issues.alfresco.com/jira/browse/MNT-9081 does not build the url in a save/correct way:
it just replaces the first occurance of the sitename in the url string with the sitename where the doc is really stored.
e.g. if the
servername is coolname
and the sitename1 is coolname
and the sitename2 is foolname
the redirect url will be: foolname/share/page/site/coolname/document-details?nodeRef=...