Firebase rewrite based on subdomain

拈花ヽ惹草 提交于 2020-08-22 05:24:58

问题


I've got a project hosted on firebase. I'd like to use a domain and subdomain as follows:

example.com: rewrite to index-landing.html
app.example.com: rewrite to index.html

Is that possible? I've tried the following under the hosting section of firebase.json:

"rewrites": [
  {
    "source": "https://example.com",
    "destination": "/index-landing.html"
  },
  {
    "source": "https://app.example.com/**",
    "destination": "/index.html"
  }
]

Any ideas?


回答1:


I have the same issue. I think rewrites only support directories not subdomains. The simple solution is to just create two different Firebase projects.




回答2:


As far as I can tell, this is now possible. I found this really good article/video while trying to find a solution: https://fireship.io/lessons/deploy-multiple-sites-to-firebase-hosting/



来源:https://stackoverflow.com/questions/43767095/firebase-rewrite-based-on-subdomain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!