How to redirect only subdomain to Firebase - firebase

Completely new to Firebase. Just developed a web app with Realtime DB and hosting at xxx.web.app. It works.
Now I want to host this at xxx.mydomain.com. However, DNS must be updated only for this subdomain. I have the main domain and other subdomains hosted elsewhere. Is this possible? Could you point to relevant docs how to achieve this? Thanks.

You would just need to setup the DNS for that ``xxx` subdomain to point to your Firebase hosting:
In this example I have bith www and api pointing to Firebase because I host both there. You culd just change your ``xxx` to point to Firebase.

Related

Hosting Firebase/Flutter app on Google subdomain

I am in the process of creating a test web app with Flutter. Is there any way to host it with firebase and have it as a subdomain of a Google domain? For example, let's say I just bought www.testsite.com through Google domains. Is there a way for me to set up webapp.testsite.com to be the firebase hosted web app?
As described in https://firebase.google.com/docs/hosting/custom-domain#expandable-1, "The host you indicate is the domain on which you want to serve content; this domain can be an apex domain or subdomain."

Firebase hosting multi site, 1 domain, 2 sub domains

I am building a website that has both an app and a control panel. I want the app to live at someurl.com and the control panel to be at controlpanel.someurl.com.
I have the someurl.com app setup, however the sub domain has confused me. From what I gather, the subdomain needs to be setup using the host of “controlpanel” and that it should point at a URL (e.g 115.110.145). My question is, what url should the subdomain point at, as firebase only gives me one URL.
All domains that are connected to Firebase Hosting utilize the same anycast IP addresses -- the Firebase Hosting serving infrastructure looks at the hostname of incoming requests to match to verified domains.
I'd recommend just following the steps in the docs and would reach out to Firebase support if you get stuck in a specific place.

concerns about required A records for setting up Firebase Dynamic Links with a custom subdomain

In setting up our own subdomain to handle Firebase Dynamic Links using these docs, the wizard says to put the A records at example.com in our DNS. I'm getting pushback from our network administrators who are wary of creating an A record at the root of our domain, which is a large e-commerce web site.
A couple of concerns/questions about this:
The IP addresses required (151.101.1.195 and 151.101.65.195) point to non-Google servers (looks like Fastly), which is a bit alarming - it seems strange that Google would outsource their deep link hosting.
We don't want all of our e-commerce traffic (coming through example.com) to be subject to these A records. Is it possible to put the A records at link.example.com instead?
The Firebase documentation on using a custom domain for dynamic links has this note:
To use a custom domain for Dynamic Links, the domain must point to Firebase Hosting. If you have a domain you want to use with Dynamic Links and the domain points to a different host, you can either move to Firebase Hosting or create a subdomain hosted by Firebase, which you can use for Dynamic Links.
So you can indeed use a subdomain for the dynamic links. In that case, just set up the subdomain in Firebase hosting. You'll need the same TXT record as normal, to prove that you have access to the domain, but then just map the subdomain (e.g. links) for the A record.
Here is the answer I received from Firebase support about these my two concerns/questions:
Regarding Fastly, Firebase uses this subprocessor to deliver content and managed services on Firebase Hosting. For more details you could check the list of Subprocessors used by Firebase on this doc.
It's possible to use a subdomain as your Firebase project's FDL domain. You'd need to create a subdomain (link.example.com) on your domain's DNS provider and connect it to Firebase Hosting. You could check out this guide for more details.

Firebase custom domain, other hosting provider

So firebase seems cool! i would love to build my angular webapp and use firebase to host it. Pushing it to firebase with my terminal seems like a dream.
I bought my custom domain on Siteground.com
When starting out with firebase it asked me to change the DNS records on siteground to direct my custom domain to firebase.
Which i did and seems to be working correctly.
My question now is, do i still need my siteground.com hosting? Maybe a newb qeustion.
But i am seriously confused now.
Cause when i want to buy a domain mostly it comes together with a hosting plan like on siteground. I dont see an option on firebase to get custom domains with firebase hosting, thats why i am wondering how this all works together.
Thanks in advance,
There are typically two services that, together, make up "web hosting".
The first is a DNS Provider. Your DNS provider is what tells computers that try to load yourdomain.com that it needs to talk to a server at IP address X.X.X.X.
The second is a Web Host (e.g. Firebase Hosting). This is what actually serves up the content for your website from an IP address.
You'll need both for your domain to work correctly, but many providers offer both services together. Firebase Hosting is a web host, but it is not a DNS provider. Typically your domain registrar is also your DNS provider and provides DNS configuration for free when you purchase a domain.
Hope that helps!

Pointing domain and subdomain to the same firebase app

Custom domain is currently setup with A record pointing to the IP of the firebase AND wildcard CNAME record pointing to the same app.
dig +short mydomain.com
151.101.65.75
151.101.1.75
dig +short abc.mydomain.com
myapp.firebaseapp.com.
app-cert.firebaseapp.com.
151.101.65.75
151.101.1.75
The problem is that "abc.mydomain.com" is redirecting to "mydomain.com" with a 301 response.
Is the problem in how the domain is setup or on the firebase end?
EDIT reply from the firebase support is:
"Unfortunately, since you've already connected your domain mydomain.com your firebase app, all redirects will go through that URL. and not to your firebase app.
"
This reply is so confusing and makes no sense IMO.
Update 2020-03-30
For several years now it's actually been entirely possible to have a subdomain pointing to a different Firebase Hosting site than the apex domain. This answer has been out of date. Happy Hosting!
Firebase Hosting presently only allows one canonical domain for your project -- if you specified mydomain.com and then point abc.mydomain.com to Firebase Hosting, it will redirect, as you saw.
We're considering some improvements in this area for the future, but at present all non-canonical domains will redirect.

Resources