YvesCoding / rcpress

基于react和Ant Design的文档生成器 🎨

Home Page:https://www.yvescoding.com/rcpress/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gitpages 请求地址失败

BadmasterY opened this issue · comments

commented

@wangyi7099 反馈个小问题

问题描述

比如当前有如下地址:
https://badmastery.github.io/relearn-webpack/webpack/Appendices/comparison.html

BTW: 当前链接点击应该可以正常跳转, 我通过修改配置文件已解决, 详细解决形式参见下方解决方案

如果直接点击, gitpages 返回 404。但是通过访问 https://badmastery.github.io/relearn-webpack/ , 以点击的形式进行访问则没有问题。

解决方案

方案1

可以通过多次调用 html-webpack-plugin 分别生成 index.html404.html 实现, 这两个文件内容一致。

方案2

修改 webpack.config 文件, 打包之后, copy index.html 重命名为 404.html 解决。