Reloading the page gives wrong GET request with AngularJS HTML5 mode

前端 未结 24 3446
慢半拍i
慢半拍i 2020-11-22 01:39

I want to enable HTML5 mode for my app. I have put the following code for the configuration, as shown here:

return app.config([\'$routeProvider\',\'$location         


        
24条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-22 01:56

    I believe your issue is with regards to the server. The angular documentation with regards to HTML5 mode (at the link in your question) states:

    Server side Using this mode requires URL rewriting on server side, basically you have to rewrite all your links to entry point of your application (e.g. index.html)

    I believe you'll need to setup a url rewrite from /about to /.

提交回复
热议问题