我在Firebase上托管了一个SPA,该SPA使用哈希路由(例如,路由/网址为mysite.com /#!/ mypath)。
我正在尝试配置Firebase托管,以将请求从“ mysite.com/mypath”重定向到“ mysite.com/#!/mypath”,但是没有运气。我尝试过:
"rewrites": [
{
"source": "/:path*",
"destination": "/index.html/#!/:path"
}
]
和:
"rewrites": [
{
"source": "**",
"destination": "/index.html/#!/"
}
]
还有:
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
"redirects": [
{
"source": "/:path*",
"destination": "/#!/:path",
"type": 301
}
]
这可能吗?路径也可以像“ mysite.com/mypath1/part2”等。