在非根目录部署wordpress时/wp-json/wp/v2/posts
这样的rest Api会访问不了
增加nginx配置(假设部署在wp文件夹下)
location /wp { if (-f $request_filename/index.php) { rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite ^/wp/(.*)$ /wp/index.php; } }
Salin selepas log masuk