用于多语言角度应用程序的Firebase托管重定向

时间:2020-05-21 08:28:37

标签: firebase-hosting

我无法为多语言应用程序配置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/**似乎已被**重定向。知道如何实现正确的重定向吗?

0 个答案:

没有答案