简体   繁体   中英

Firebase Dynamic Links with Subdomain

I have successfully configured Firebase Dynamic Links with my own domain at a link like this:

https://example.com/links/

On example.com I can serve my site (through Firebase Hosting) without any problems, and on example.com/links I have my dynamic links. Everything went smoothly there, I had to add this to my firebase.js :

"rewrites": [
      {
        "source": "/links/**",
        "dynamicLinks": true
      }
]

What I want to do now, is have the same thing but on links.example.com subdomain in place of the /links path. This should be possible according to Firebase's docs, but when I try to create the URL prefix in the Console it asks me to add this to my firebase.js :

"rewrites": [
      {
        "source": "/**",
        "dynamicLinks": true
      }
]

I tried that, and the Dynamic Links do work, but my whole site is treated as a dynamic link now, even when using example.com without the links. subdomain.

Am I missing something here? Something I can add to the firebase.js or configure in the Console to only treat the subdomain as a Dynamic Link?

You would want to create an additional Hosting site in your project for the subdomain rather than add an additional subdomain to your existing site. On that site, you could deploy just the dynamic links config without any additional files.

There is no way to configure a single Firebase Hosting site to serve different content based on the domain.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM