# OneInStack 下部署 WordPress Multisite 的 Nginx 转发规则

- Link: https://www.ixiqin.com/2022/03/25/oneinstack-deployment-under-the-wordpress-multisite-nginx-forwarding-rules/
- Published: 2022-03-25T06:00:00+08:00
- Author: 白宦成

在 OneIn Stack 下如果需要配置一套 WordPress MU 的话，需要配置 Nginx 相应的转发规则。
具体的规则如下：

    ```php
     if (!-e $request_filename) {            
     	rewrite /wp-admin$ $scheme://$host$uri/ permanent;            
     	rewrite ^(/[^/]+)?(/wp-.*) $2 last;            
     	rewrite ^/[^/]+(/.*.php)$ $1 last;    
     }    
     location / {        
     	try_files $uri $uri/ /index.php?$args;    
     }
    Code language: PHP (php)
    ```

将上述规则放置在 `/usr/local/nginx/conf/rewrite/wordpressmu.conf` ，并在创建 VHost
时选择对应的主机即可。

## Comments

### By: tk

- Link: https://www.ixiqin.com/2022/03/25/oneinstack-deployment-under-the-wordpress-multisite-nginx-forwarding-rules/#comment-437
- Published: 2022-03-25T10:52:26+08:00

文章越来越像笔记了。。。

### By: 白宦成

- Link: https://www.ixiqin.com/2022/03/25/oneinstack-deployment-under-the-wordpress-multisite-nginx-forwarding-rules/#comment-438
- Published: 2022-03-25T10:53:33+08:00

博客严格意义上来说，就是给我自己的笔记。

我写博客首先写给自己，然后才是写给读者。
