我的 404 页面不工作
My 404 page isn't working
我的 404 页面不工作。我的 .htaccess 文件中的代码是
ErrorDocument 404 /error.html
即使我有此代码(它应该将您发送到 404 页面),我仍然得到 404 GitHub 页面。
这是我的 github 回购文件:
- https://github.com/BrundinNet/BrundinNet.github.io/blob/master/.htaccess
- https://github.com/BrundinNet/BrundinNet.github.io/blob/master/error.html
为什么会这样?
我找到了一个 GitHub 帮助站点(参见 here),总结如下:
- 在名为
404.html
的根级别创建一个新的 HTML 文件
添加以下 YAML front matter 代码(这意味着它位于文件顶部并且是不同的语言):
--
permalink: /404.html
--
- 从
error.html
添加您的内容!
希望这对您有所帮助,好问题!我还在 GH 页面网站 (cgs-jack-bashford.github.io) 上工作,这是研究事物的好方法 - 检查 Stack!
我的 404 页面不工作。我的 .htaccess 文件中的代码是
ErrorDocument 404 /error.html
即使我有此代码(它应该将您发送到 404 页面),我仍然得到 404 GitHub 页面。
这是我的 github 回购文件:
- https://github.com/BrundinNet/BrundinNet.github.io/blob/master/.htaccess
- https://github.com/BrundinNet/BrundinNet.github.io/blob/master/error.html
为什么会这样?
我找到了一个 GitHub 帮助站点(参见 here),总结如下:
- 在名为
404.html
的根级别创建一个新的 HTML 文件
添加以下 YAML front matter 代码(这意味着它位于文件顶部并且是不同的语言):
-- permalink: /404.html --
- 从
error.html
添加您的内容!
希望这对您有所帮助,好问题!我还在 GH 页面网站 (cgs-jack-bashford.github.io) 上工作,这是研究事物的好方法 - 检查 Stack!