When hosting a static webpage on Firebase using a custom domain - let's say example.com - the page is still also available as examplecomproject.firebaseapp.com.
This is bad, because it generates duplicated content. But I don't find a way to disable hosting unter the *.firebaseapp.com subdomain. The only way seems to be including a correct
<link rel="canonical" href="https://example.com/..." />
in every *.html file. Sadly this is not feasible in my current setup.
Is it possible to configure Firebase to
- stop responding to the subdomain?
- to 301 redirect the subdomain to my custom domain?
- prevent this problem in some other way?
There is another question regarding a similar problem. I opted to raise a new question, since in contrast to the old one, my question is specific for Firebase Hosting and it's about preventing duplicated content.