如下图加上这句试一下 rewrite ^(.+?\.php)(/.+)$ /$1?s=$2 last;
location / {
if (!-e $request_filename) {
rewrite ^(.+?\.php)(/.+)$ /$1?s=$2 last;# 加上这一句配置试试
rewrite ^(.*)$ /index.php?s=$1 last;
#rewrite ^(.*)$ /EtxTQIoerX.php?s=$1 last;
break;
}
}

本文介绍如何在location块中添加新的rewrite规则,用于处理.php文件请求,并通过's=$2'参数传递额外路径信息。重点在于理解并应用location条件和last关键字的使用。

1万+

被折叠的 条评论
为什么被折叠?



