I am building an Ionic PWA, in which I have implemented the Deep linking.
IonicModule.forRoot(MyApp, {}, {
links: [
{ component: FeaturedPage, name: 'FeaturedPage', segment: ':title' },
{ component: HomePage, name: 'HomePage', segment: ':title' },
{ component: LatestPage, name: 'LatestPage', segment: ':title' },
{ component: TopPage, name: 'TopPage', segment: ':title' },
{ component: TrendingPage, name: 'TrendingPage', segment: ':title' },
{ component: ListPage, name: 'ListPage', segment: ':title' },
{ component: ItemDetailsPage, name: 'ItemDetailsPage', segment: 'Categories/:category' }
]
}),
By default, it is generating an URL which contains "#".
As per the requirement, I had to remove the "#" so I did research and found that, with the help of following I can remove the "#" from the URL.
import { LocationStrategy, PathLocationStrategy } from '@angular/common';
{ provide: LocationStrategy, useClass: PathLocationStrategy },
I got success in results. Now the URL does not contain "#"
However, when I am refreshing this page, then I am getting an error
I know that, in order to overcome this type of error, there is the need of putting "#" in the URL, but now I do not want to have "#" nor I want the error after refreshing the page, Is there anybody, who can let me know, how to get rid of this?