修改后重启Nginx

1
2
3
4
5
location /子目录/ {
if (!-e $request_filename) {
rewrite ^(.*)$ /子目录/index.php$1 last;
}
}

根目录规则:

1
2
3
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}