gitlab - GitLab 不从根仓库提供 404.html 错误页面
问题描述
我创建了username.gitlab.io
带有index.html
和404.html
页面的仓库,这些页面必须自动部署。
部署后,如果我在浏览器地址中打开username.gitlab.io
它会显示良好的index.html
页面,如果我打开username.gitlab.io/404.html
它也显示良好。
但!!
如果我尝试打开username.gitlab.io/not_existing_file
它会显示内部 GitLab 错误页面,但不是我的。
同时:
如果我创建具有reponame
相同内容的存储库,它将从该存储库404.html
很好地提供页面/reponame/not_existing_file
。
我究竟做错了什么?
内部 GitLab 错误页面显示:..you don't have the necessary permissions..
,但 reporeponame
具有与username.gitlab.io
.
有没有人遇到过这个问题?
解决方案
“为您的 GitHub Pages 站点创建自定义 404 页面”确实提到了/404.html
.
然而,gitlab-pages issue 183指向error-page-demo/error-page-demo.gitlab.io
它在不存在的文件上有相同的问题,即使error-page-demo.gitlab.io/404.html
确实存在。
这仍然悬而未决,MR 130仍然开放。
2021 年 11 月更新:exaucae在评论中提到MR 130 已与MR 263合并并修复。
所以这现在是可能的。
事实上,MR 263 将允许命名空间域
404.html
为公共项目提供自定义文件。
当存在父命名空间域并且是公共的时,它还允许为私有项目提供相同的自定义错误页面。
推荐阅读
- agora.io - Agora RTC - Agora-SDK [DEBUG]: Ignoring event undefined
- flutter - What is the best way to make fullscreen for flutter video_player?
- r - R Studio 1.3.959 Errors in Installing Packages?
- java - How can I make a package inside of a package in eclipse?
- php - Symfony 4 - 创建一个新项目(它不起作用)
- javascript - 将文件从 React.JS 前端移动到 C++ 后端
- reactjs - 如何将 React JS 应用程序调试到 Cordova?
- maven - Groovy 和 Maven:陷入编译和测试一个非常简单的问题
- java - Cucumber + Spring Boot 的“路径必须存在”
- ios - 无法同时满足约束。以下列表中的至少一个约束可能是您不想要的约束