無名 发表于 2010-12-2 15:23:21

nginx下使用codeigniter

小弟在nginx的vhost下加下了rewrite rule, 但出現了500 Internal Server Error. 請求師兄教一下.

想使用的framework是codeigniter

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

heii 发表于 2012-12-9 18:25:27

CI在LNMP下的Rewrite这样写:location / {
        if ($request_uri ~* ^/system) {
                rewrite ^/(.*)$ /index.php?/$1 last;
                break;
        }

        if (!-e $request_filename) {
                rewrite ^/(.*)$ /index.php?/$1 last;
                break;
        }
}建军哥更新到lnmp里。

[ 本帖最后由 heii 于 2012-12-9 18:28 编辑 ]

licess 发表于 2012-12-9 18:42:54

好的

helloniu 发表于 2013-6-6 16:51:17

还有就是$config['uri_protocol']        = 'REQUEST_URI';选这个才行    nginx貌似默认不支持path_info
页: [1]
查看完整版本: nginx下使用codeigniter