Angular2 routing / deep linking not working with Apache 404

前端 未结 7 2009
自闭症患者
自闭症患者 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:00

    You have to make your server handle all routes back to index.html or use HashLocationStrategy

    (https://angular.io/docs/ts/latest/api/common/index/HashLocationStrategy-class.html)

    Take a look at:

    Is Angular 2's Router broken when using HTML5 routes?

提交回复
热议问题