Angular 6 route path not working for direct url when deployed in subdirectory : <p>app.routing.module.ts</p>

<pre><code>import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './public/home/home.component';

const routes: Routes = [
  {
    path: 'customers',
    loadChildren: '../app/customers/customers.module#CustomersModule'
  },
  {
    path: 'admin',
    loadChildren: '../app/admin/admin.module#AdminModule'
  },
  {
    path: 'home',
    component: HomeComponent
  },
  {
    path: '**',    
    redirectTo: 'home',    
  }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
</code></pre>

<p>These works fine under the <strong>Development environment</strong>.
If I directly open <code>localhost:4200/home</code> then it's landing on the expected page.</p>

<p>However, the one <strong>built</strong> and <strong>deployed</strong> using with <code>ng build --prod --base-href=/myngapp/</code> do works only on <code>www.domain.com/myngapp</code> if I open the <code>www.domain.com/myngapp/home</code> directly, then it gives 404 not found error.</p>
