Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
根目录以外的其他目录中的Firebase 404.html_Firebase - Fatal编程技术网

根目录以外的其他目录中的Firebase 404.html

根目录以外的其他目录中的Firebase 404.html,firebase,Firebase,我的自定义404页面位于目录/404/index.html。但是firebase要求它位于根目录,并命名为404.html。我试着在自定义位置重写它,但似乎不起作用。我可以知道是否无法定义404页面所在的自定义位置吗 { "hosting": { "rewrites": [ { "source": "/404.html", "destination": "/404/index.html" } ] } } 试试“source”:“404.h

我的自定义404页面位于目录
/404/index.html
。但是firebase要求它位于根目录,并命名为
404.html
。我试着在自定义位置重写它,但似乎不起作用。我可以知道是否无法定义404页面所在的自定义位置吗

{
  "hosting": {
    "rewrites": [ {
        "source": "/404.html",
        "destination": "/404/index.html"
    } ]
  }
}

试试
“source”:“404.html”
?刚刚试过,同样的事情。只有在导航到
www.mysite.com/404
时,我才能获得自定义的404页面。如果我导航到
www.mysite.com/somePath/notExist
,我会从文档中获得默认的firebase 404页面,看起来不可能。你不想在根目录中使用404.html有什么特别的原因吗?没有,因为我正在使用一个Jekyll主题,它在不同的位置生成它。我可能会找到一种方法来定制主题,以生成适合firebase位置的主题。更糟糕的情况是,我将只编写一个用于复制文件的post脚本。请尝试
“source”:“404.html”
?刚刚尝试过,同样的事情。只有在导航到
www.mysite.com/404
时,我才能获得自定义的404页面。如果我导航到
www.mysite.com/somePath/notExist
,我会从文档中获得默认的firebase 404页面,看起来不可能。你不想在根目录中使用404.html有什么特别的原因吗?没有,因为我正在使用一个Jekyll主题,它在不同的位置生成它。我可能会找到一种方法来定制主题,以生成适合firebase位置的主题。更糟糕的情况是,我将只编写一个用于复制文件的post脚本。