Firebase托管:提供来自不同自定义域的不同页面

时间:2017-05-18 12:32:18

标签: firebase subdomain firebase-hosting

我们在firebase托管上使用自定义域:我们的应用程序(从index.html提供)在app.example.com上运行良好。我们还连接了www.example.com,也为该应用提供服务。

问题是:在www.example.com上我希望能够托管一个简单的静态页面。有没有办法在重写中配置它?我们可以在部署中轻松输出额外的html文件,在index.html旁边。

有什么想法吗?

我们的firebase.json:

{
  "database": {
    "rules": "database.rules.json"
  },
  "hosting": {
    "public": "public",
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}

1 个答案:

答案 0 :(得分:3)

Firebase Hosting目前不支持单个项目中的多个站点。但是,您可以为静态登录页面创建第二个项目并将其部署到那里,将其连接到www域,同时将应用程序域连接到另一个项目。

截至2018年8月,Firebase Hosting支持单个项目上的多个站点!有关详细信息,请参阅the docs

相关问题