Heim > Fragen und Antworten > Hauptteil
if (-f $request_filename/index.php){
rewrite (.*) /index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
黄舟2017-05-16 17:15:51
if (-f $request_filename/index.php)
#如果存在文件$request_filename/index.php
{
rewrite (.*) $1/index.php;
#那么执行这条 rewrite
# $1代表上面if里匹配的
}
if (!-f $request_filename){
#如果不存在文件$request_filename
rewrite (.*) /index.php;
#那么执行这条 rewrite
}