且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

重定向到Firebase托管自定义域

更新时间:2023-10-13 21:25:34

您无法关闭子域名。您的应用始终可以在 https://myapp.firebaseapp.com 上设置自定义域名。



要重定向人,您可以向您的HTML添加一个规范链接:

 < link rel =canonicalhref =http://myapp.domain.com//> 

详细了解在Google网站管理员中心博客上指定您的规范


I have setup a custom domain with Firebase Hosting (eg. myapp.domain.com).

How can one redirect (or turn off) the default Firebase Hosting URL (eg. myapp.firebaseapp.com) so that the app is only accessible from the custom domain?

You cannot turn off the subdomain. Your app will always be available on https://myapp.firebaseapp.com and whatever custom domain you've set up.

To redirect people, you can add a canonical link to your HTML:

<link rel="canonical" href="http://myapp.domain.com/" />

Read more about that in Specify your canonical on the Google Webmaster Central Blog.