【发布时间】:2018-07-13 12:30:24
【问题描述】:
我刚开始在 firebase 上托管一个 Web 应用程序。
使用firebase cli (firebase-tools) 的自动设置在我的公共文件夹中创建了一个404.html 文件。
但我不想看到自定义的 404 错误页面,也不想看到来自 firebase 的默认页面。
我想将所有 404 重定向到起始页,以便应用程序无论如何都会被初始化。 (我使用webpack-dev-server 的本地设置工作正常)
解决方法是将index.html 中的相同内容放入404.html。但这会导致维护翻倍..
我在这里找到了一些关于重定向配置的信息https://firebase.google.com/docs/hosting/url-redirects-rewrites。
但无法重定向 404 错误类型。
无法使用.htaccess 文件。
我是否错过了更改此行为的正确位置,无论是在我的 firebase.json 文件还是在 https://console.firebase.google.com/ 中??
【问题讨论】:
标签: firebase http-status-code-404 firebase-hosting