只需在nginx.conf中加入以下代码即可:
if (-f $request_filename/index.htm){ rewrite (.*) $1/index.htm break; } if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; }
只需在nginx.conf中加入以下代码即可:
if (-f $request_filename/index.htm){ rewrite (.*) $1/index.htm break; } if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; }