Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitpages 请求地址失败 #35

Open
BadmasterY opened this issue Sep 3, 2020 · 0 comments
Open

gitpages 请求地址失败 #35

BadmasterY opened this issue Sep 3, 2020 · 0 comments

Comments

@BadmasterY
Copy link

BadmasterY commented Sep 3, 2020

@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 解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant