VPS侦探论坛

标题: lnmp1.4下typecho404页面不生效 [打印本页]

作者: JohnChiu    时间: 2017-8-1 22:08
标题: lnmp1.4下typecho404页面不生效
就是目前lnmp1.4环境,但是typecho的自定义404页面没有效果,甚至不会显示nginx的404页面,只会提示:


找不到 blog.dearjohn.cn 的网页
找不到与以下网址对应的网页




是不是跟vhost的conf有关?麻烦军哥看一下~ 另外同一个服务器上的wordpress站点就没有这个问题~

  1. server
  2.     {
  3.         listen 80;
  4.         #listen [::]:80;
  5.         server_name blog.dearjohn.cn ;
  6.         index index.html index.htm index.php default.html default.htm default.php;
  7.         root  /home/wwwroot/typecho;

  8.         include typecho.conf;
  9.         #error_page   404   /404.html;

  10.         # Deny access to PHP files in specific directory
  11.         #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

  12.         include enable-php.conf;

  13.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  14.         {
  15.             expires      30d;
  16.         }

  17.         location ~ .*\.(js|css)?$
  18.         {
  19.             expires      12h;
  20.         }

  21.         location ~ /.well-known {
  22.             allow all;
  23.         }

  24.         location ~ /\.
  25.         {
  26.             deny all;
  27.         }

  28.         access_log off;
  29.     }
复制代码


作者: JohnChiu    时间: 2017-8-2 08:57
对了,同样的conf在lnmp1.3下没有问题,1.3加上include enable-php-pathinfo.conf;才能伪静态,但是404都正常跳转的,1.4不加pathinfo也能伪静态,但不论加不加都无法正常跳转404~
可能是1.4的bug吗?
作者: licess    时间: 2017-8-2 12:21
http://docs.typecho.org/themes/custom-404

1.3和1.4的虚拟主机配置文件上没区别




欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/) Powered by Discuz! X3.4