server
{
listen 80;
server_name www.xx.com;
index index.php;
root /data/www/xxx;
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.html;
include fasccgi.conf;
}
if (!-e $request_filename) {
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
if 如果找不到要访问的文件,进行重定向操作
重定向到 /index.php?s=url参数 thinkphp的URL兼容模式
这样就可以以 HOST/模块/控制器/操作 的url路径方式隐藏index.php访问