Skip to content

gitpages 请求地址失败 #35

@BadmasterY

Description

@BadmasterY

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions