Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ajax CodeIgniter禁止使用查询字符串uri协议的字符_Ajax_Codeigniter_Query String_Encodeuricomponent - Fatal编程技术网

Ajax CodeIgniter禁止使用查询字符串uri协议的字符

Ajax CodeIgniter禁止使用查询字符串uri协议的字符,ajax,codeigniter,query-string,encodeuricomponent,Ajax,Codeigniter,Query String,Encodeuricomponent,我一直在做一个项目,并在localhost和免费web服务器上测试它,它工作得非常好。然而,当我拥有自己的域名和网络托管服务时,网站停止了工作 为了让它起作用,我不得不把重写规则改为 RewriteRule ^(.*)$ /index.php?$1 [L] 然后设置 $config['uri_protocol'] = 'QUERY_STRING'; 但是像这样的链接, http://www.mydomain.com/ajax/membersearch/anemail%

我一直在做一个项目,并在localhost和免费web服务器上测试它,它工作得非常好。然而,当我拥有自己的域名和网络托管服务时,网站停止了工作

为了让它起作用,我不得不把重写规则改为

    RewriteRule ^(.*)$ /index.php?$1 [L]
然后设置

    $config['uri_protocol'] = 'QUERY_STRING';
但是像这样的链接,

    http://www.mydomain.com/ajax/membersearch/anemail%40here.com
用于工作,但现在它返回一个CI错误,表示您提交的URI包含不允许的字符


在我不得不更改RewriteRule和uri_协议之前,它工作得非常好,所以我想知道是什么让它现在不工作,以及如何修复它?

您可能需要更新config.php文件。将默认允许的字符设置替换为以下行:

$config['permitted_uri_chars'] = 'a-z 0-9~%\.\:_\+-,';

等等…%和默认为。。。让我检查一下我的假设是您可能想将uri\u协议设置回PATH\u INFO-您可能可以添加?如果您还需要查询字符串,则将and=转换为允许的字符,尽管我从未在CI中尝试过。通常,在使用参数时,我不需要查询字符串URI。