|
发表于 2013-12-24 10:14:31
|
显示全部楼层
搞了两天,终于用nginx配合CI搞定了这个重写功能了。
不过我的目标不同:
1、根目录按照普通网页方式访问;
2、子目录下放很多不同的CI网站。
我的配置思路是在NGINX中仅配置一个根目录,但下面对各个子目录配置CI的重写规则,如:
server {
listen 80;
server_name xxx.yyy;
root /data_dir;
include extra/my.inc;
location /ci_dir/
{
if ($request_filename !~* /ci_dir/(index\.php|templates)){
rewrite ^/ci_dir/(.*)$ /ci_dir/index.php?$1 last;
}
}
location /pri/
{
return 404;
}
}
|
|