我无法为多语言应用程序配置Firebase托管重定向。我为每种语言生成了一个不同的应用程序,我想使重定向工作如下:
{
"hosting": {
"public": "www",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "index.html"
},
{
"source": "es/**",
"destination": "es/index.html"
}
],
"headers": [
{
"source": "**",
"headers": [ {
"key": "Cache-Control",
"value": "max-age=0"
} ]
},
{
"source": "**/*.@(jpg|jpeg|gif|png|svg)",
"headers": [ {
"key": "Cache-Control",
"value": "max-age=18000"
} ]
}
]
}
}
因此,https://my-app.com/angular/route
仅重定向到主应用程序,而https://my-app.com/es/angular/route
重定向到es
应用程序。在当前设置下,所有内容都将重定向到主应用程序,因为es/**
似乎已被**
重定向。知道如何实现正确的重定向吗?