jackchengwc 发表于 2011-4-29 18:03:59

ci + nginx 伪静态,应该怎么配置啊?

ci + nginx 伪静态,应该怎么配置啊?网上找了一堆一堆的例子都不能解决问题,哪位大神能说一下
apache 的规则 是 CI 帮助里面的
RewriteEngine on
RewriteCond $1 !^(index\.php|public|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1
用了一个 在线的 转换工 具 ,转换出来,服务器商 说不成功 是 这个样子的
if ($1 !~ "^(index\.php|public|images|robots\.txt)"){
        set $rule_0 1$rule_0;
}
if ($rule_0 = "1"){
        rewrite ^/(.*)$ /index.php/$1 last;
}

叫服务器商给弄 ,尼玛,他说他们不会,叫我写好了给他们,各位大神 ,求救啊?
哪位大神知道可以加我QQ:285547372 ,也可以跟贴 给我,小弟我感激不尽啊~~

erebus 发表于 2011-4-30 16:14:37

顶一下,有个项目做,服务器是nginx,同样不知道怎么配置伪静态。

kylidboy 发表于 2011-5-1 00:55:50

nginx的重写语句应该是location吧?
if (!-f $request_filename) {
                                location / {
                                       
                                        rewrite ^/(.*)$ /index.php/$1;

                                }
      }

haohailuo 发表于 2011-5-1 23:06:23

location / {
            indexindex.php index.html index.htm ;

            if (!-e $request_filename) {
                rewrite ^/(.+)$ /index.php/$1 last;
            }
      }

注意要让nginx支持path_info

jackchengwc 发表于 2011-5-3 22:17:47

回复 4# haohailuo
这位哥 你好,我空间商里面只加了这段代码,就可以了
rewrite ^(.*)$ /index.php/$1 last;
但是让我郁闷的是 在根目录加了一个public 的文件夹,写绝对路径,居然读不到
<link href="/public/css/index_css.css" rel="stylesheet" type="text/css">
读不到,还没有转换这段,哪位高手,写来转换一下哈
RewriteCond $1 !^(index\.php|public|images|robots\.txt)
页: [1]
查看完整版本: ci + nginx 伪静态,应该怎么配置啊?