`
chengxianju
  • 浏览: 248665 次
  • 性别: Icon_minigender_1
  • 来自: 合肥
社区版块
存档分类
最新评论

window nginx codeigniter rewrite

 
阅读更多

apache下只用。htaccess

 

RewriteEngine on
RewriteCond $1 !^(index\.php|css|themes|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
 

nginx不支持rewriteCond,nginx配置方法:

 

 

server { 
        listen          80; 
        server_name     act; 
        location / {
            root   D:/ci_act;
            index  index.html index.htm index.php;
            autoindex on;
            rewrite ^/$ /index.php last;
            rewrite ^/(?!index\.php|css|themes|images|robots\.txt)(.*)$ /index.php/$1 last;
        }
        location ~ ^(.+\.php)(.*)$ {
           fastcgi_pass   127.0.0.1:9000;
           fastcgi_index        index.php;
           fastcgi_split_path_info ^(.+\.php)(.*)$;
           fastcgi_param        PATH_INFO                $fastcgi_path_info;
           fastcgi_param        PATH_TRANSLATED        D:/ci_act$fastcgi_path_info;
           fastcgi_param  SCRIPT_FILENAME  D:/ci_act$fastcgi_script_name;
           include        fastcgi_params;
        }
    }


 

 

 

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics