I suppose it’s impossible to update OP with my current permissions so I’ll just share some useful details here.
So it’s end up Mediawiki actually using localized identifiers for special page URLs so redirect isn’t really an option once there is non-English UTF-8 in URL. Browsers tend to encode URLs and it’s tricky to make redirection work with either Nginx or Apache configuration.
So instead of adding redirect it’s possible to just hardcode url within Mediawiki in this file:
./includes/skins/SkinTemplate.php
Find (line 682 in my version):
$login_url = [
'text' => $this->msg( $loginlink )->text(),
'href' => self::makeSpecialUrl( 'Userlogin', $returnto ),
'active' => $title->isSpecial( 'Userlogin' )
|| $title->isSpecial( 'CreateAccount' ) && $useCombinedLoginLink,
];
Then get it to look like this:
$login_url = [
'text' => $this->msg( $loginlink )->text(),
'href' => '/discourse-sso.php',
// 'href' => self::makeSpecialUrl( 'Userlogin', $returnto ),
'active' => $title->isSpecial( 'Userlogin' )
|| $title->isSpecial( 'CreateAccount' ) && $useCombinedLoginLink,
];