Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 831
netshark1000 Avatar asked Aug 30 '17 17:08

netshark1000


1 Answers

The solution is very simple:

 { path: '**', component: NotFoundComponent }
like image 87
netshark1000 Avatar answered Sep 18 '22 17:09

netshark1000