I have an angular 4 project, and when I run it from localhost:4200/route-a , it works fine, and when I update the browser, everything works fine as expected. However, when I create it using ng build and run it from apache, switching to localhost/route-a returns a 404 . Here is my routing code:
imports: [BrowserModule, HttpModule, FormsModule, RouterModule.forRoot([ { path: 'home', component: HomeComponent }, { path: 'route-a', component: RouteAComponent }, { path: '', redirectTo: '/home', pathMatch: 'full' } ])]
source share