Angular2 routing / deep linking not working with Apache 404

前端 未结 7 2013
自闭症患者
自闭症患者 2020-11-29 01:17

I am following the Angular 2 routing examples. Using the \"lite\" webserver I am able to navigate from the root and deep linking works, but using Apache I can navigate fro

7条回答
  •  鱼传尺愫
    2020-11-29 02:17

    For angular4/angular in app.routes.module.ts include useHash as below,

    @NgModule({
      imports: [RouterModule.forRoot(routes, {useHash: true})],
      exports: [RouterModule]
    })
    

提交回复
热议问题