我已将我的自定义域( bar.com )和子域( foo.bar.com )连接到Firebase,并且它们按预期工作。 但是,我希望我的子域重定向到 / baz ,而不是重定向到根,同时在地址栏中仅显示子域。
我一直在搞弄DNS设置,并在firebase.json的托管对象中进行重写和重定向,但无济于事。
您似乎只能通过Firebase进行301或302重定向,如下所示:
"redirects": [
{
"source": "fundraiser.icbamerica.org",
"destination": "/fundraiser",
"type": 301
}
]
重写必须转到/index.html,因为它是通过React生成的SPA:
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
有人知道该怎么做吗?