无法从子域重定向到主域

Can't redirect from subdomain to main domain

我有 2 个项目。第一个项目在主域中,第二个项目在子域中。当我单击菜单项以从子域重定向到主域时,它会将我重定向到:https://subdomain.maindomain.com/https://maindomain.com/

代码:

echo Nav::widget([
    'options' => ['class' => 'navbar-nav navbar-right'],
    'items' => [
        ['label' => 'Menu 1', 'url' => ['https://maindomain.com/']],
        ['label' => 'Menu 2', 'url' => ['https://maindomain.com/1']],
    ],
]);

所以我只需要在点击子域项目中的菜单时重定向到 https://maindomain.com/

尝试将 URL 放在括号外。例如:

['label' => 'Menu 1', 'url' => 'https://maindomain.com/'],