https://test.com/ --> primary site (works fine!)
https://test.com/r/ --> multisite (doesn't work!)
https://test.com/rx/ --> multisite (works fine, but is not, what we want)
// It's a possible match!
$scores[$i] = 8 + strlen($parsedPath);
...
// One Pence point if it's the primary site in case we need a tiebreaker
if ($site->primary) {
$scores[$i]++;
}
see: https://github.com/craftcms/cms/blob/develop/src/web/Request.php starting from line 1191.
When the $parsedPath is only 1 letter, it has the same score as the primary site and thus the arsort($scores, SORT_NUMERIC) in line 1219 will not sort the sites correctly.
Thanks for reporting that! We just released Craft 3.4.3 with a fix for it.
Most helpful comment
Thanks for reporting that! We just released Craft 3.4.3 with a fix for it.