【发布时间】:2017-05-11 02:01:49
【问题描述】:
我有一个开发服务器,用于上传客户端网站,每个 WordPress 站点都有自己的数据库和目录(每个站点都是独立的)。我有一个服务器块。我的问题是漂亮的永久链接,这对我有用:
server_name dev.example.tld;
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; allow all; }
location / {
try_files $uri $uri/ =404;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-$
expires off;
}
location /site_1/ {
index index.php;
try_files $uri $uri/ /site_1/index.php?$args;
}
location /site_2/ {
index index.php;
try_files $uri $uri/ /site_2/index.php?$args;
}
我一直在寻找一种方法来做一次,而不是为每个站点添加位置块,但没有运气。
【问题讨论】:
标签: php wordpress nginx configuration permalinks