简体   繁体   中英

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.

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