if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; }
if (-f $request_filename/index.php) #如果存在文件$request_filename/index.php { rewrite (.*) /index.php; #那么执行这条 rewrite # 代表上面if里匹配的 } if (!-f $request_filename){ #如果不存在文件$request_filename rewrite (.*) /index.php; #那么执行这条 rewrite }