如何解决宝塔BT面板搭建WordPress站点主题下的404页面不生效的问题?

网站最近迁移到宝塔面板后,发现主题自带的404页面却失效了,网站的404页面变成了宝塔面板自带的。其原因是网站配置文件里默认开启了Nginx的404默认页面。宝塔面板自带的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

主题自带的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

 文章源自MAY的SEO博客-https://may90.com/building/404-display.html 文章源自MAY的SEO博客-https://may90.com/building/404-display.html

  • 我的微信
  • 扫一扫微信,添加好友
  • weinxin
  • 我的微信公众号
  • 关注公众号,了解最新动态
  • weinxin
  • 本文由 发表于 2019年3月9日
  • 转载请务必保留本文链接:https://may90.com/building/404-display.html
HTTP状态码完整清单 SEO技术

HTTP状态码完整清单

Internet上有两个主要角色,即客户端和服务器。当您打开笔记本电脑并单击浏览器(例如Google Chrome)时,您正在通过Web客户端访问Internet。您正在请求发送到网络服务器以访问页面...
评论  2  访客  1  作者  1
    • boke112导航 6

      这个方法确实挺简单实用的 :wink:

        • MAY的SEO博客

          @ boke112导航 对的,找到原因后再解决就容易了。 :mrgreen:

      发表评论

      匿名网友 填写信息

      :?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

      确定