title: How to route in angular 4
body: <p>I have an angular 4 project and when I run it from <code>localhost:4200/route-a</code>, it works fine and when I refresh the browser, all works well as expected. However, when I build it with <code>ng build</code> and run it from apache, navigating to <code>localhost/route-a</code> returns a <code>404</code>. Here is my code for routing: </p>
  
  <pre><code>imports: [BrowserModule, HttpModule, FormsModule, RouterModule.forRoot([
      { path: 'home', component: HomeComponent },
      { path: 'route-a', component: RouteAComponent },
      { path: '', redirectTo: '/home', pathMatch: 'full' }
    ])]
  </code></pre>