Firebase托管将www.example.com重定向到example.com

时间:2016-09-30 14:00:13

标签: web firebase firebase-realtime-database

我已经通过Firebase托管完成了我的网站设置,一切正常。 问题是我的网站从www.example.com重定向到example.com

我该如何预防呢?我怎样才能始终www.example.com/

这是我的firebase.json

"hosting": {
"public": "files",
"ignore": [
  "firebase.json",
  "**/.*"
],
"headers": [ {
  "source" : "**/*.@(jpg|jpeg|gif|png)",
  "headers" : [ {
    "key" : "Cache-Control",
    "value" : "max-age=7200"
  }]
  }],
"cleanUrls": true }

1 个答案:

答案 0 :(得分:1)

您已在Firebase Hosting console中注册example.com个域名。因此,域名指向那里。

将该域注册为www.example.com,它将始终显示为此。请注意,您的TXT记录仍然位于顶点(即example.com),您可以按原样保留DNS配置,假设www和顶点已正确指向Firebase托管。

相关问题