找到Nginx环境下站点的伪静态规则文件,一般是“域名.conf”。在local /下面添加代码。完整示例:
location / { if (!-e $request_filename) { rewrite /common/(.*)$ /common.php/$1 last; rewrite /api/(.*)$ /api.php/$1 last; rewrite ^(.*)$ /index.php?s=$1 last; break; } }