0

当我使用:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|favicon\.ico|robots\.txt|class|style|js)
RewriteRule ^(.*)$ /index.php/$1 [L]

在 .htaccess 和:

$config['uri_protocol'] = "PATH_INFO";

在 config.php 中,结果是:我的 WINDOWS 服务器说:一切正常,我的 LINUX 服务器说没有指定输入文件

所以我以这种方式更改 .htaccess :

RewriteEngine on
RewriteCond $1 !^(index\.php|images|favicon\.ico|robots\.txt|class|style|js)
RewriteRule ^(.*)$ /index.php?/$1 [L]

在 config.php 中:

$config['uri_protocol'] = "QUERY_STRING";

比:一切正常,但 $_GET 不行!!!我怎样才能在这样的设置中使用 $_GET ?简单的:

parse_str($_SERVER['QUERY_STRING'], $_GET);

现在不起作用

4

3 回答 3

0

升级到 CodeIgniter Reactor 2.0,$_GET 适用于大多数安装。2.0.1 将在本周发布,它有更好的支持。

于 2011-03-09T11:11:43.767 回答
0

您可能正在使用 fastcgi PHP,这意味着您应该查看 CI 的故障排除用户指南:http: //codeigniter.com/user_guide/installation/troubleshooting.html

- 编辑 -

我误解了这个问题。启用查询字符串应通过 CI 配置完成。查看此用户指南页面的底部: http: //codeigniter.com/user_guide/general/urls.html

于 2011-03-08T08:32:29.693 回答
0

解决了......我用这个:

$ru = $_SERVER['REQUEST_URI'];
parse_str(substr($ru,strpos($ru,'?')+1), $_GET);

现在我可以再次使用 $_GET

于 2011-03-08T13:19:01.703 回答