Thinkphp 3.1.2 The Official Handbook, section 16.2, "Hidden index.php", mentions hiding index in Ngnix.PHP implements a SEO-friendly approach, which uses the following code location/ { if(!-E$request _filename) {rewrite^ (. *) $/index.php?s=$1Last ; Break; }} This method performance is very poor, because the image file will also be the existence of a file, the increase in disk IO overhead, in the "Nginx HTTP Server" in the book mentioned an optimization method, that is, modified to the following code. Location/ { if($request _filename~* "\. (GIF|JPG|JPEG|PNG|SWF|JS|CSS) ") { Break;//image files are no longer rewritten, and file presence is no longer judged, allowing Nginx to avoid useless checks and reduce disk IO overhead } if(!-E$request _filename) {rewrite^ (. *) $/index.php?s=$1Last ; Break; }}#simple to no technical content, but the effect is good ~
Optimization of PathInfo mode in thinkphp