【发布时间】:2020-08-14 15:45:21
【问题描述】:
我有一个托管在 firebase 上的 SPA,它使用哈希路由(例如,路由/url 是 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”等。
【问题讨论】:
标签: firebase redirect url-rewriting firebase-hosting