13

I just set up new Firebase Hosting and my custom domain and my web page, etc...

Everything works great, except what is really bothering me are default Domains:

  • projectname.web.app
  • projectname.firebaseapp.com

Looking around googling, I have not found a solution, how to remove or disable them... Any suggestion? This seems really annoying. It could be a show stopper for me...

abraham
  • 46,583
  • 10
  • 100
  • 152
5er
  • 2,506
  • 7
  • 32
  • 49
  • can i ask why do you need to do that? – Ivan Chernykh Apr 23 '20 at 20:18
  • 3
    @Cherniv, Why do I need 3 domains? I have minedomain.com and .web.app and .firebaseapp.com... Having the last two is unprofessional... Why on earth would I want to have those two... For testing? ok. But sure not public... – 5er Apr 23 '20 at 20:35
  • It's not possible to turn it off – Bart Apr 23 '20 at 21:54
  • 1
    @Bart is it possible to make it private or redirect? IMO this is really bad design... Or am I making noise for nothing? – 5er Apr 23 '20 at 22:11
  • 1
    @Cherniv is correct and they cannot be turned off. Unless you link the .web.app or .firebasapp.com domains anywhere (on Google or social media etc.), there is no way anyone would be able to find them or access them. Think you should be fine. – Ryan Apr 24 '20 at 02:32
  • Does this answer your question? [Google Domain - How to remove/disable default domain after adding custom domain?](https://stackoverflow.com/questions/45058710/google-domain-how-to-remove-disable-default-domain-after-adding-custom-domain) – abraham Apr 24 '20 at 19:19

2 Answers2

19

I have contacted Firebase Hosting help. According to them, you can not disable, remove, hide or make them private. Meaning they will always be there and be accessible to the public...

Their official answer;

  • what you can do is to add in the header (suggested by Firebase Hosting):
<link rel="canonical" href="http://myapp.domain.com/" />

However, this did not work for me out of the box. I asked Google to re-index my web page (still waiting at this point to re-index).

  • another approach (also suggested by Firebase Hosting), redirect:
//check if the url
if (window.location.hostname == "yourapp.web.app" || 
    window.location.hostname == "yourapp.firebaseapp.com") {
       window.location.href = 'http://yourcustomdomain'; 
}
benomatis
  • 5,536
  • 7
  • 36
  • 59
5er
  • 2,506
  • 7
  • 32
  • 49
-2

After logging in to firebase in the console, follow this procedure to disable the hosting, the default domain in the firebase project will be automatically disabled with the hosting.

C:\cmder
λ firebase hosting:sites

C:\cmder
λ firebase hosting:disable --project <Your Project ID>

I'm using cmder as console

enter image description here

enter image description here

enter image description here

Mridul Das
  • 133
  • 6