Search code examples
firebasefirebase-hosting

Use Firebase SSL Hosting for two different web applications


It appears that I can only have one Top Level Domain (TLD) associated with one firebaseapp SSL hosting. Is that true?

For example, I'd like https://x.example.com to go to my https://x.firebaseapp.com and https://y.example.com to go to my https://y.firebaseapp.com

When I try I see: (see image below) (I'm using https://city.tidalforce.org/ for a different firebase app at https://cityregister.firebaseapp.com/ but I'd like to use the same domain for another app with another full name such as https://y.tidalforce.org

Is this possible?

enter image description here


Solution

  • In short no, although you may be able to host different apps in different subfolders like https://example.com/x, https://example.com/y and if they have javascript router for example, if you are using Angular for front-end and using Angular-router or something you will nee to provide appropriate rewrite rules like:

    "rewrites": [ {
      "source" : "/x/**",
      "destination" : "/x/index.html"
    },
    {
      "source" : "/grid/**",
      "destination" : "/grid/index.html"
    } ]
    

    to rewrite url requests from that folder to route correctly.

    Hope it helps :)