Wordpress固定链接产生404的问题解决方法

描述问题:固定链接出现404问题,不能修改么?那存在的意义在哪。找了一圈,最后发现需要添加一段代码在网站配置文件里。

我用的是宝塔面板,比较好操作。

在伪静态文件里,添加如下一段代码,Nginx不用重启,保存就可以了,404问题解决。

[kbd]

location / {

        index index.html index.php;

        if (-f $request_filename/index.html){

                rewrite (.*) $1/index.html break;

        }

        if (-f $request_filename/index.php){

                rewrite (.*) $1/index.php;

        }

        if (!-f $request_filename){

                rewrite (.*) /index.php;

        }

}

rewrite /wp-admin$ $scheme://$host$uri/ permanent;

[/kbd]

About the Author

懒码虫

遇到问题,发现问题,解决问题。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

You may also like these