Thinkphp supports PathInfo method sharing under the lower version of Nginx, Nginxpathinfo
Recently in the use of thinkphp to do a project, the basic completion of deployment to the Nginx server only to find that Nginx is not supported pathinfo so how do we handle it.
Nginx Environment
In Nginx low version, PathInfo is not supported, but can be passed in nginx.conf (in/usr/local/nginx/conf/nginx.conf or through Find/| grep nginx.conf to find the location) in configure the forwarding rule implementation: Add in nginx config file:
Location/{if ' (!-e $request _filename) { rewrite ^ (. *) $/index.php?s=$1 last;
In fact, the internal is forwarded to the thinkphp provided by the compatibility mode URL, in this way, you can solve other non-support PathInfo Web server environment.
If your thinkphp is installed in a level two directory, the Nginx pseudo-static method is set as follows, where Youdomain is the directory name in which it resides.
location/youdomain/{if (!-e $request _filename) {
Such as:
location/thinkphp/{if (!-e $request _filename) { rewrite ^/thinkphp/(. *) $/thinkphp/index.php?s=$1 last;}}
Syntax: Rewrite regex replacement flag (last equivalent to the [L] tag inside Apache, indicating rewrite. )
http://www.bkjia.com/PHPjc/1133067.html www.bkjia.com true http://www.bkjia.com/PHPjc/1133067.html techarticle thinkphp in the lower version of Nginx support PathInfo method sharing, Nginxpathinfo recently in a project with thinkphp, basically completed after the deployment to the Nginx server only to find Nginx is not supported ...