thinkphp nginx 配置

thinkphp convention配置:
'URL_MODEL' => '2', //URL模式

nginx rewrite配置:
 if (!-e $request_filename) {
   rewrite  ^(.*)$  /index.php?s=$1  last;
   break;
    }

如果你的ThinkPHP安装在二级目录,Nginx的伪静态方法设置如下,其中youdomain是所在的目录名称
location /youdomain/ {
        if (!-e $request_filename){
            rewrite  ^/youdomain/(.*)$  /youdomain/index.php?s=$1  last;
        }
    }
 
原文地址:https://www.cnblogs.com/yangcclg/p/5610141.html