之前我爱模板网分享了隐藏入口index.php的htaccess配置,详见:thinkphp The requested URL was not found on this server.。这次分享下nginx的配置方法:
修改nginx配置文件:
location ~* (runtime|application)/{ return 403; } location / { if (!-e $request_filename){ rewrite ^(.*)$ /index.php?s=$1 last; break; } }