nginx配置wordpress伪静态

2018年11月14日 Off By yyy
  vi /etc/nginx/nginx.conf
  server {

………..

  if (!-e $request_filename) {
        # Don't use `$uri` here, see https://github.com/yandex/gixy/issues/77
        rewrite /wp-admin$ $scheme://$host$request_uri/ permanent;
        rewrite ^(/[^/]+)?(/wp-.*) $2 last;
        rewrite ^(/[^/]+)?(/.*\.php) $2 last;
    }

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

……….

}