How can I set a default route in my @Routes route metadata collection? If you use the angular2 router from @angular/router-deprecated you define the routes in @routeConfig
I faced same issue apply all possible solution but finally this solve my problem
export class AppRoutingModule { constructor(private router: Router) { this.router.errorHandler = (error: any) => { this.router.navigate(['404']); // or redirect to default route } } }
Hope this will help you.