Firebase托管:为来自不同自定义域的不同页面提供服务 [英] Firebase hosting: Serve different pages from different custom domains

查看:54
本文介绍了Firebase托管:为来自不同自定义域的不同页面提供服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在Firebase托管上使用自定义域:由index.html提供服务的我们的应用程序可以在app.example.com上很好地运行.我们还连接了www.example.com,该网站也为该应用程序提供服务.

We're using custom domains on firebase hosting: our app, served from index.html, runs nicely on app.example.com. We've also connected www.example.com, which serves the app as well.

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

The problem is: on www.example.com I want to be able to host a simple static page. Is there a way to configure this in the rewrites? We can easily output an extra html file in the deploy, next to index.html.

有什么想法吗?

我们的firebase.json:

Our firebase.json:

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

推荐答案

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

Firebase Hosting does not support multiple sites in a single project at this time. However, you can create a second project for your static landing page and deploy it there, connecting it to the www domain while leaving the app domain connected to the other project.

截至2018年8月,Firebase Hosting在一个项目中支持多个站点!有关更多信息,请参见文档.

As of August of 2018, Firebase Hosting supports multiple sites on a single project! See the docs for more info.

这篇关于Firebase托管:为来自不同自定义域的不同页面提供服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆