title: Routing not working in production
body: <p>I was developing a web application in Angular 2, its working fine in my localhost, but when i hosted in production environment its not working
  my sub-domain is replacing with empty string</p>
  
  <p>My production server is 
  <strong><a href="http://foobar:8888/Hrms" rel="noreferrer">http://foobar:8888/Hrms</a></strong></p>
  
  <p>where "Hrms" is sub-domain that is where i hosted my "publish files"</p>
  
  <p>when i run in local the url was : <strong><a href="http://localhost:50739/#/access/login" rel="noreferrer">http://localhost:50739/#/access/login</a></strong>
  and in server the sub-domain missing automatically : <strong><a href="http://foobar:8888/#/" rel="noreferrer">http://foobar:8888/#/</a></strong></p>
  
  <p>i tried <strong><a href="http://foobar:8888/hrms/#/access/login" rel="noreferrer">http://foobar:8888/hrms/#/access/login</a></strong> but it still going to <strong><a href="http://foobar:8888/#/" rel="noreferrer">http://foobar:8888/#/</a></strong> automatically</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>var domainName = "";
  if (location.hostname !== "localhost")
      domainName = "HRMS/";
  
  const appRoutes: Routes = [
  {
      path: "access", component: AccessComponent,
      children: [
          { path: "", redirectTo: "login", pathMatch: "full" },
          { path: domainName + "login", component: LoginComponent, data: { title: "Login" }, canActivate: [UserGuard] },
          { path: domainName + "forgot-password", component: ForgotPasswordComponent, data: { title: "Forgot Password" }, canActivate: [UserGuard] },
          { path: domainName + "not-found", component: PageNotFoundComponent, data: { title: "Page Not Found" } },
          { path: domainName + "lock-me/:path", component: LockComponent, data: { title: "Locked" }, canActivate: [LockGuard] }
      ]
  },
  {
      path: "app", component: LayoutComponent,
      canActivate: [AuthGuard],
      children: [
          { path: "", redirectTo: "getting-started", pathMatch: "full" },
          { path: domainName + "dashboard", component: DashboardComponent, data: { title: "Dashboard" } },
          { path: domainName + "getting-started", component: GettingStartedComponent, data: { title: "Getting Started" } },
          { path: domainName + "accounts", component: AccountsComponent, data: { title: "Accounts" } },
          { path: domainName + "organization", component: OrganizationComponent, data: { title: "Organization" } },
          { path: domainName + "interviews", component: InterviewsComponent, data: { title: "Interviews" } }
      ]
  },
      { path: "", redirectTo: domainName + "access/login", pathMatch: "full" },
      { path: "**", redirectTo: domainName + "access/not-found", pathMatch: "full" }
  ];
  
  @NgModule({
      imports: [
          RouterModule.forRoot(appRoutes, { useHash: true })
      ],
      exports: [
          RouterModule
      ]
  })
  export class AppRouting { }
  </code></pre>
  
  <p>Please let me know, when did i do wrong
  Thanks.</p>