Configure Amazon S3 static site with Angular JS ui.router html5Mode(true) on page refresh

前端 未结 4 1299
栀梦
栀梦 2020-12-10 04:04

How can I configure an Amazon S3 static webpage to properly route Angular ui.router html5Mode routes? On page refresh, it will make a request for a file that doesn\'t exist,

4条回答
  •  天涯浪人
    2020-12-10 04:33

    Basically there are 3 options, use an EC2 instance to perform the actual server rewrites to the configured HTML5 routes, or, like dnozay suggested, use the fallback mode and re-write requests to use the #! hashbang. Finally, you could just use the standard angular routes, which is the option I went with. Less hassle, and when Angular 2.0 rolls around, you can update to that.

    https://stackoverflow.com/a/16877231/1733117

    Doesn't really address the routing issue here.

提交回复
热议问题