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;
        }
    }
 
posted @ 2016-06-23 11:32  洋葱土豆随心匠  阅读(225)  评论(0编辑  收藏  举报