网站最近迁移到宝塔面板后,发现主题自带的404页面却失效了,网站的404页面变成了宝塔面板自带的。其原因是网站配置文件里默认开启了Nginx的404默认页面。
我们如何来解决呢?文章源自MAY的SEO博客-https://may90.com/building/404-display.html
将宝塔面板默认设置的404页面删除或注释掉即可。文章源自MAY的SEO博客-https://may90.com/building/404-display.html
方法:宝塔面板 - 网站 - 选择你的网站 - 设置 - 配置文件 - 找到下面的代码:文章源自MAY的SEO博客-https://may90.com/building/404-display.html
error_page 404 /404.html; error_page 502 /502.html;
直接删除掉,或者注释掉:文章源自MAY的SEO博客-https://may90.com/building/404-display.html
#error_page 404 /404.html; #error_page 502 /502.html;
最后刷新一下缓存。文章源自MAY的SEO博客-https://may90.com/building/404-display.html
文章源自MAY的SEO博客-https://may90.com/building/404-display.html
主题自带的404页面成功显示!问题解决。文章源自MAY的SEO博客-https://may90.com/building/404-display.html
文章源自MAY的SEO博客-https://may90.com/building/404-display.html
文章源自MAY的SEO博客-https://may90.com/building/404-display.html 文章源自MAY的SEO博客-https://may90.com/building/404-display.html


1F
这个方法确实挺简单实用的
B1
@ boke112导航 对的,找到原因后再解决就容易了。