I am facing an issue with removing the # from the URL. When I try to remove it, the application encounters a problem upon deployment to the server. Upon page refresh, a 404 error status is returned.
For instance:
https://example.com/user/1 (works)
https://example.com/user/2 (does not work)
In app-routing.module.ts:
@NgModule({
imports: [RouterModule.forRoot(routes)],
providers: [
{provide: LocationStrategy, useClass: PathLocationStrategy}
],
exports: [RouterModule]
})
In app.module.ts:
......
providers: [ Location, {provide: LocationStrategy, useClass: PathLocationStrategy}]
I would appreciate any guidance on how to resolve this issue.