Reputation:
Does anybody have an idea how to redirect to another url when a page is not found in Angular 4, because { path: "**", redirectTo: "/error" },
seems to be not working (at least for me)?
Upvotes: 0
Views: 388
Reputation: 1083
make sure you have route defined for path "error" in your routes configuration, if yes add pathMatch: 'full' to the definition as well
{ path: "error", component: ErrorComponent },
{ path: "**", redirectTo: "/error", pathMatch: 'full' }
Upvotes: 1