我的规则如下,但我希望这只适用于原点是除当前域以外的任何其他域。
如果我的域名是friends.com,则所有内容都应该转到索引,否则请按以下方式处理。例如,如果来自Google,使用类似friends.com/user
的路径,则应调用firebase https function
而不是转发索引。
{
"hosting": {
"public": "y",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [{
"source": "/user",
"function": "user"
},
{
"source": "/post",
"function": "post"
},
{
"source": "/*",
"destination": "/index.html"
}
],
"headers": [{
"source": "/css/**",
"headers": [{
"key": "Cache-Control",
"value": "max-age=0"
}]
}]
}
}