netshark1000
netshark1000

Reputation: 7413

Angular: 404 page but keep url

I wrote a custom 404 page in Angular 4 and want to keep the wrong url that was entered. You can see the behavior on github for example. They display a 404 page for not existing urls. Example: https://github.com/cdkdfjkdjf

Currently I configured my router like this:

{ path: '404', component: NotFoundComponent },
{ path: '**', redirectTo: '404' }

Any idea how to archive this?

Upvotes: 5

Views: 1064

Answers (1)

netshark1000
netshark1000

Reputation: 7413

The solution is very simple:

 { path: '**', component: NotFoundComponent }

Upvotes: 12

Related Questions