使用以下firebase.json
,我可以将用户重定向到所需的maintenance.html
页面。但是,该页面使用304状态代码检索。我希望使用503状态代码来检索它,以指示搜索引擎这是临时维护。我试图手动设置标题,但似乎无法正常工作。如何在Firebase中完成?
{
"hosting": {
"public": "build",
"ignore": [],
"redirects": [ {
"source": "/index.html",
"destination": "/maintenance.html",
"type": 307
} ],
"rewrites": [
{
"source": "**"
, "destination": "/index.html"
}
],
"headers": [
{
"source": "/maintenance.html",
"headers": [ {
"key": "status",
"value": "503"
} ]
}
]
}
}
答案 0 :(得分:0)
以下是对我有用的东西:
{
"hosting": {
"public": "build",
"ignore": [],
"redirects": [
{
"source": "/index.html",
"destination": "/maintenance.html",
"type": 307
}
],
"headers": [
{
"source": "/maintenance.html",
"headers": [ {
"key": "status",
"value": "503"
} ]
}
]
}
}