我有以下路由器:角4路由器:入門重定向孩子的第一路中
const routes: Routes = {
{
path: '',
pathMatch: 'full',
redirectTo: 'en'
},
{
path: 'en',
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'homepage'
},
{
path: 'homepage',
component: HomeComponent
},
]
},
}
我想會是什麼,當我去我http://example.com
我被重定向到/en/homepage
直接。 現在,發生了什麼是我只被重定向到/en
。我在路由器配置中缺少什麼?
redirectTo: '/ EN'和redirectTo:'/ en/homepage'。默認情況下,重定向不是相對的,好像你期待的那樣 –