AngularJS - html5Mode - Cannot GET /login

前端 未结 6 986
感动是毒
感动是毒 2020-12-31 12:07

Hi have created one angularJS application with yeoman, grunt and bower. I have enabled the html5Mode for the application. And its working. But, when I refresh a page (localh

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-31 12:21

    By now, this must be a common issue with Angular to be dealt with for routing to work.

    I found similar issues on SO, which suggest the same html5 config to workaround the hashbang method - see AngularJS: how to enable $locationProvider.html5Mode with deeplinking Also a tutorial at scotch.io https://scotch.io/quick-tips/pretty-urls-in-angularjs-removing-the-hashtag can be a start.

    But most importantly, I remember that this is the one that did the trick.

    https://gist.github.com/leocaseiro/4305e06948aa97e77c93

    I run a Apache Web server. I don't recollect at what level (globally or per app) I did the configuration, but best would be to consult the web server docs, Apache's was good.

提交回复
热议问题