2011-03-08 38 views
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); 

没有你可能使用FastCGI PHP,这意味着你应该看看CI的用户指南故障排除现在的工作

回答

0

http://codeigniter.com/user_guide/installation/troubleshooting.html

- 编辑 -

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

+0

是的,我不能将cgi.fix_pathinfo设置为0;可能会引发问题。设置$ config ['index_page'] =“index.php?”没有任何区别;没有这一切的一切工作 - 问题是 - 如何使用/实现$ _GET现在? – Erroid 2011-03-08 12:49:25

0

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

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

现在我可以再次使用$ _GET

+0

这不是你应该怎么做 - 看看这个页面的底部:http://codeigniter.com/user_guide/general/urls.html或在我更新的问题。 – Repox 2011-03-08 14:44:40

0

升级到笨反应器2.0,$ _ GET适用于大多数安装。本周2.0.1将会有更好的支持。