Overview

Recently, I was trying to play with Wordpress, and found that after years of not seeing it, it is still a bit better, and now in addition to the XML-RPC method, there are other ways to operate, one of which is the REST API, which is natively supported, and I will document this feature here.

This is a photo caption.
The following is a list of the most important things you can do for your business.

Configuring Nginx

  1. [root@liqiang.io]# cat /etc/nginx/default.d/default.conf
  2. server {
  3. ...
  4. if (-f $request_filename/index.html){
  5. rewrite (. *) $1/index.html break;
  6. }
  7. if (-f $request_filename/index.php){
  8. rewrite (. *) $1/index.php;
  9. }
  10. if (! -f $request_filename){
  11. rewrite (. *) /index.php;
  12. }
  13. rewrite /wp-admin$ $scheme://$host$uri/ permanent;
  14. }

Restart Nginx

  1. [root@liqiang.io]# nginx -t
  2. [root@liqiang.io]# nginx -s reload

Adding access control

install plugin

configuration plugin

Memorandum

List Publish’s Post interface does not require authentication, so you need to keep that in mind when testing.