天使漫步IT工作室天使漫步IT工作室

宝塔BT安装的wordpress或者typecho去掉index.php引起404问题


Warning: count(): Parameter must be an array or an object that implements Countable in /www/wwwroot/u11u.com/usr/themes/wq/functions.php on line 110

Warning: count(): Parameter must be an array or an object that implements Countable in /www/wwwroot/u11u.com/usr/themes/wq/functions.php on line 116

由于宝塔在nginx中配置为默认走index.php规则,所以如果固定链接中去掉index.php的话,需要在宝塔的配置中引入一条规则:

规则如下:

location / {
      try_files $uri $uri/ /index.php?$args;
    }

经过验证,wordpress和typecho都成功。

本站原创,欢迎转载,转载敬请标明出处:天使漫步IT工作室 » 宝塔BT安装的wordpress或者typecho去掉index.php引起404问题
已有 3 条评论
  1. 文章不错非常喜欢

  2. 第一次来访,表示支持

    1. 天使漫步 天使漫步

      谢谢。

添加新评论


Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /www/wwwroot/u11u.com/usr/themes/wq/comments.php on line 38