gpt4 book ai didi

html - Google Cloud Storage 上的网站配置没有错误页面

转载 作者:搜寻专家 更新时间:2023-10-31 23:03:35 24 4
gpt4 key购买 nike

我有一个单页应用程序,我正在(尝试)托管在 Google Cloud Storage 上。

应用程序位于 index.html,应用程序使用 Angular 的 html5Mode 处理路由。 (例如:由 index.html 中的 js 应用程序处理的 example.com/this 和 example.com/等路由)

使用 Google Cloud Storage 的网站配置这一切都很好,除了直接访问的路由(“example.com/this”)将出现 404,因为它们显然没有映射到文件.

我已将我的 404 页面设置为我的索引页面,但为了在 html5Mode 中运行单页应用程序,我真正需要的是此类路由(“example.com/this”)不会返回 404 header -它们将仅由 index.html 处理并返回成功 header (200)。

这可能吗?

最佳答案

从网站配置中将 index.html 设置为您的 404 页面现在似乎可以解决问题。

enter image description here

关于html - Google Cloud Storage 上的网站配置没有错误页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24178825/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com