Mobile app version of vmapp.org
Login or Join
Moriarity557

: Firebase Custom Domain - add admin subdomain? I'm hosting my website on Firebase and I got the domain from GoDaddy. I used custom domain, and everything works great. This is the way I redirect

@Moriarity557

Posted in: #Cname #Godaddy #SrvRecords #Subdomain

I'm hosting my website on Firebase and I got the domain from GoDaddy.

I used custom domain, and everything works great.

This is the way I redirect to my website on Firebase:



I need to create an admin subdomain like admin.example.com. So it will redirect to my admin page on Firebase: myapp.firebaseapp.com/admin.html.

How can I do that? When I'm adding a CNAME, I get an error.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Moriarity557

1 Comments

Sorted by latest first Latest Oldest Best

 

@Radia820

The mistake here is not understanding the what A and CNAME records support:


A records will only support IP addresses.
CNAME records will only support valid domains.


Therefore using a full URL path within the CNAME Points to field is not correct, since a URL is not a domain.

In this instance the correct setting is: subdomain.firebaseapp.com.

DNS points to servers not paths

It is a common mistake by many webmasters that they believe the DNS hosting is responsible for pointing to the content, this is not true.

The DNS is responsible for pointing to the server that hosts the content, nothing more. It is then the responsible of your server to negotiate where your content is located, this is normally done through server side settings, generally referred and known as a virtual host file.

Adding your custom domain within the FireBase Console will add this information to their server-side virtual host file.

Quick Summary of DNS


Your DNS points to the IP address or cname domain of the server hosting your content.
Your server translates the domain to where physically your files are stored through the virtual host file.


Redirect are server-side not DNS side

The other issue you have is that you want the domain to point to admin.html, this can not be set by the domain DNS and will need to be controlled by FireBase. Firebase supports redirects using json, so if you want users to automatically be redirected to admin.html you need to use that method, or another simpler method would be to rename admin.html to index.html, therefore no redirect would be required.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme