【发布时间】:2018-06-20 04:45:09
【问题描述】:
我正在使用 SPA,并且我的本地开发环境为任何 404 提供 index.html 文件。这样可以在加载应用程序时保持 URL 不变。我的应用程序路由选择 URL 并显示正确的页面。
我目前在 s3 中有 404 重定向到 index.html
当前行为
- 导航到 www.example.com/clients
- s3检测到404
- 重定向到 www.example.com/index.html
- SPA 看到端点是 /index.html 并且找不到页面
期望的行为
- 导航到 www.example.com/clients
- 检测404
- 服务 index.html 无重定向
- SPA 看到端点是 /clients 并显示客户端页面
我希望我可以在不需要运行服务器的情况下实现这一目标
【问题讨论】:
标签: amazon-web-services amazon-s3 amazon-cloudfront