1.最近在做一个wordpress项目,后台和首页都是可以访问的
但是自己定义了一个接口访问就是404错误!
服务器配置的是nginx
本地测试
2.解决办法:
第一先要确定wp-options里的路径是否正确
第二看下nginx的重写配置是否正确
3.最后去修改了nginx的配置
在/etc/nginx
加入如下配置:
location /xxx{
if(!-f request_filename){
rewrite(.*)/xxx/index.php;
}
}
rewrite /wp-admin scheme:// host$uri/permanent;
4.重新启动nginx
sudo service nginx restart
ok!