大网数据广告活动
网站运营与故障问答

Firebase Custom Domain - add admin subdomain?

· 52CE 我爱测

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.…

问题原文

原帖链接 · Sahar Milis · CC BY-SA 3.0

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.

已采纳解答

原帖链接 · Simon Hayter · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-10-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。