|
做好的项目,在本地的服务器上运行没有问题,可是放到国外(新加坡)的服务器上就出现问题了。
登陆界面可以出现,但是登陆后却是出现:
The URI you submitted has disallowed characters.
我一个同事遇到过这一样的问题
修改两个文件的代码就可以,具体如下:
Fixed: “The URI you submitted has disallowed characters.” error CodeIgniter
How to fix it. (assuming codeigniter 1.7)
1) in codeigiter system/libraries open URI.php line 189 you’ll find
if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", rawurlencode($str)))
Change that to:
if ( ! preg_match("|^[".($this->config->item('permitted_uri_chars'))."]+$|i", rawurlencode($str)))
Note we removed the preg_quote(). Now in your system/application/config/config.php file look for line 126 (unless you’ve added a lot to you config will be around there somewhere)
Change the line
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';
to:
$config['permitted_uri_chars'] = 'a-z 0-9~%\.\:_\-';
we’re now preparing our allowed character string in the config file and skipping preg_quote. And that’s it. Now your uri should work
但是现在我现在修改之后还是不可以,有没有人遇到过这样同类的问题,是怎么解决的?
谢谢啦! |
|