You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何取消Firebase重定向,恢复至默认index.html页面访问

撤销Firebase重定向并恢复根路径默认跳转

要取消之前设置的根路径301重定向,让用户访问https://subdomain.mydomain.com时自动跳转至index.html,按以下操作即可:

  • 打开项目根目录下的firebase.json文件,找到hosting配置里的redirects数组。
  • 删除其中指向维护页的那条规则:
    {
      "source": "/",
      "destination": "https://subdomain.mydomain.com/maintenance/",
      "type": 301
    }
    
  • 如果redirects数组里没有其他规则,可以直接把整个redirects字段删掉,或者保留空数组"redirects": []。
  • 保存文件后,在终端运行部署命令使修改生效:
    firebase deploy --only hosting
    

Firebase Hosting默认会将根路径/映射到index.html,所以删除重定向规则后,访问根域名就会自动加载index.html页面。

内容的提问来源于stack exchange,提问作者sandalwoodsh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.08 19:30:38