ThinkPHP的项目位于二级目录,Nignx下的伪静态设置方法

[shell]
server{
listen *:80;

server_name www.baidu.com;
index index.html index.php index.htm;
root /wwwroot/www.baidu.com;

error_log /var/log/nginx/error_www.baidu.com.log;

location ~.*\.(php|php5)?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}

location /www.4wei.cn/ {
if (!-e $request_filename){
rewrite ^/www.4wei.cn/(.*)$ /www.4wei.cn/index.php?s=$1 last;
}
}
}
[/shell]

路径为/wwwroot/www.baidu.com/www.4wei.cn/