我正在使用 Firebase 托管来托管网站,并且我正在使用自定义域名。我希望我的网站成为让我们说的目的地:https ://example.com
我还使用使用相同域但使用不同前缀的 firebase 动态链接。
像这样:https ://links.example.com
网站主机和动态链接工作正常,但问题是我不知道如何以允许站点(example.com)和子域(links.firebase)工作的方式编写我的 firebase.json 重写.com),我可以将其用于我的动态链接。
如果我使用以下重写,动态链接将起作用:
"rewrites": [
{
"source": "/**",
"dynamicLinks": true
}
]
但是这样主网站(example.com)会显示一条关于不是有效动态链接的消息,而不是显示 index.html
TL/DR 我想知道是否可以让网站 (example.com) 和动态链接 (links.example.com) 在同一个域 (example) 上工作?
提前致谢
编辑 1: 我已重命名 index.html,这就是我没有看到该网站的原因。现在我把它改回来了,但是动态链接不行。links.example.com 显示 index.html
编辑 2: 它最终按预期工作:example.com 和 links.example.com 指向 index.html,而像 links.example.com/aShortDynamicLinkCode 这样的任何格式都会激活动态链接。
我在 Firebase.json 中使用了以下重写来实现这一点
{
"source": "**",
"dynamicLinks": true
},
{
"source": "/**",
"dynamicLinks": true
},