在我的 firebase URL 中,当我转到 https://example.web.app 时,它显示来自 Firebase 的“找不到站点”。
但是如果我去 https://example.web.app/index.html,URL 会工作,它会显示
index.html
页面。
我如何让它指向默认页面 aka 主页,而不是我必须重定向到
index.html
页面?
firebase.json
:
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
dist/index.html
存在。
dist
目录用于 public
托管。
index.html
在我重定向到 https://example.web.app/index.html
时工作正常,但在我转到 https://example.web.app
时不起作用,我该如何解决?
URL只是一个“例子”,试图给大家解释一下。这不是实际网址。
最好的选择是联系 Firebase 客户支持并向他们寻求帮助。
如果你检查 url https://your-website-name.firebaseapp.com,你会发现它有效但不是 https://your-website-name.web.app.
要解决这个问题,运行以下命令行代码: curl -X PURGE https://your-website-name.web.app.
我遇到了同样的问题,并得到了 Google 支持团队的帮助。