【发布时间】:2021-12-06 21:48:21
【问题描述】:
我在这里看到了很多解决这个问题的问题,但是使用 apache 服务器,对于我的应用程序,我使用 AWS S3 和 Cloudfront,我需要应用程序在 URL 上没有丑陋的哈希值的情况下工作。
有没有什么方法可以在不使用哈希的情况下直接刷新或点击链接?
如果需要代码的任何部分,我可以包含它,但我认为没有必要,因为没有任何问题,我只需要一个可行的策略。
问候。
我的应用路由模块
@NgModule({
imports: [
RouterModule.forRoot(routes, { useHash: true })
],
exports: [
RouterModule
]
})
删除哈希 true 可用于导航,但不适用于页面刷新或直接链接
【问题讨论】:
-
I need the application to work without the ugly hash为什么?你想达到什么目标? -
嗯,产品管理人员认为哈希不友好,对他们不起作用。我可以忍受它,但我没有悲伤地提出要求。
-
检查 404 的配置。它应该返回 index.html stackoverflow.com/questions/43101013/…
标签: angular amazon-web-services amazon-s3 single-page-application amazon-cloudfront