Latest update of ionic made the url so clean by removing excess keywords. By using code below able to remove hashbang # inside the url path.
IonicModule.forRoot(MyApp, {
locationStrategy: 'path'
})
I had set the @IonicPage
@IonicPage({
segment: 'home'
})
After deployed to my server, I access the page like below:
http://192.168.208.125:8080/home/#/asdasdasdasd -> able to access homepage
http://192.168.208.125:8080/home/asdasdasdasd -> 404 not found
My question is, are there any methods to redirect user to different pages if user direct access a non-existing URL path? Like what router can do:
{path: '404', component: NotFoundComponent},
{path: '**', redirectTo: '/404'}
Thank you. Any recommendation and suggestions are welcome.