2012-02-13 85 views
2

我从apache移动到lighttpd,从那以后某些URL打破了重写并给出了404。access.log中没有任何细节,关于实际URL被击中的error.log。Lighttpd改写为Codeigniter打破某些URL

这些方面的工作: http://192.168.1.250/loop/rest/admin

但不是这些: http://192.168.1.250/loop/rest/admin/logs/file::log-2012-02-14.php

如果我跳过重写和使用 http://192.168.1.250/loop/rest/index.php?/admin/logs/file::log-2012-02-14.php

我得到了我想要的东西,

这里是我的改写规则:

url.rewrite-once = (
"/(.*)\.(.*)" => "$0", 
"/(css|files|img|js|stats)/" => "$0", 
"^/([^.]+)$" => "/loop/rest/index.php/$1" 
) 

任何帮助,将不胜感激。

回答

0

我已经找到了正确的规则:

首先请确保你的根指令指向您的CI setupd的根源。

root /var/www/loop; 

那么这个位置的指令将完全正常工作:

location/
    { 
    if (!-e $request_filename) 
    { 
     rewrite ^/(.*)$ /index.php?/$1 last; 
     break; 
    } 
    } 
4

我只是有同样的问题上lighttpd的

测试我笨应用

时,这个工作对我来说:

url.rewrite = (
     ".*\.(js|ico|gif|jpg|png|swf|css|html)$" => "$0", 
     "^/(.*)$" => "index.php/$1" 
) 

也许你可以试试这个适合你的设置:

url.rewrite = (
      ".*\.(js|ico|gif|jpg|png|swf|css|html)$" => "$0", 
      "^/(.*)$" => "/loop/rest/index.php/$1" 
    ) 

确保你的顶部没有注释mod_rewrite ..它默认带有#前面的#。

+0

感谢您的输入,但是我发现,工程:)简单得多规则 – BlackDivine 2012-03-07 01:29:56