热度 1|
if (!-f $request_filename){
rewrite ^/([^\.]+[^/])$ http://$host/$1$2/ permanent;
}
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
如果网站开启了https或者适用了小程序,那么请使用如下PHP规则:
if (-d $request_filename) {
rewrite ^/(.*)([^/])$ https://$http_host/$1$2/ permanent;
}