我有以下定义的路由:
const routes: Routes = [
{ path: 'Home', component: DashboardComponent },
{ path: '', redirectTo: '/Home', pathMatch: 'full' },
{ path: '**', component: NotFoundComponent },
];
并且基础链接应该设置为这样:
<base href="/Site1/" />
当我访问localhost/Site1时,我得到了NotFound组件,但我希望它重定向到/Home。
如果我尝试localhost/Site1/(带有尾随正斜杠),它会匹配默认路由并重定向到/Home。
如何使第一个URL正确重定向?