reuixiy / io-oi.me

Blog of reuixiy!
https://io-oi.me
Other
98 stars 40 forks source link

ipfs 自定义 404 页面 #223

Closed z1un closed 2 years ago

z1un commented 2 years ago

自定义 404 页面

现在,您可以通过在请求路径中的某个位置包含 ipfs-404.html 文件来自定义 404 未找到错误页。

如果找不到请求的文件,go ipfs 将在与请求的文件相同的目录和每个父目录中查找 ipfs-404.html。如果找到,将返回此文件(带有 404 状态代码),而不是通常的错误消息。

来自 IPFS0.6.0 更新,已测试确实可以。

z1un commented 2 years ago

建议可以生成两套 404 页面,一个正常 404.html,一个用于 ipfs 的 ipfs-404.html,或者在配置文件中由用户自选生成。

reuixiy commented 2 years ago

添加了说明,感谢!