Vue.js Router: history mode and AWS S3 (RoutingRules)

前端 未结 5 1454
难免孤独
难免孤独 2021-01-31 10:03

I have a Vue.js application up and running with Amazon S3 and Cloudflare.

When I open the index and browse to /dashboard, everything works fine. But when I open a route

5条回答
  •  无人及你
    2021-01-31 10:38

    I know this answer comes late but in case someone else is looking for another way to solve this in cloudfront, there's no need to create custom pages on s3 redirecting users when pages are not found. Instead of doing it, custom error responses can be created in cloudfront for the distribution.

    This will always redirect to /index.html in case a file is not found and that will make the app route trigger.

提交回复
热议问题