1

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:

DNS Records

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.

Adding CNAME record - error

1 Answer 1

3

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

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.