“The URI you submitted has disallowed characters.” CI Poblem Now Solved


When setup an CI application on my localhost its successfully install. But application links that use application route does not work. It show “The URI you submitted has disallowed characters.” error message. After googling the problem find that its PHP version related problem, you can also say that a CI version problem. But what is it not matter, I need to fix the bug and time is short. So its simple solution we can try:

As my application CI version is 1.7 do the following:

=> Go to system/libraries/URI.php

When open URI.php go to line 189 and you will find below:
if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", rawurlencode($str)))

Change it to below:
if ( ! preg_match("|^[".($this->config->item('permitted_uri_chars'))."]+$|i", rawurlencode($str)))

=> Then go to system/application/config/config.php

Open the file config.php and go to line 126 and you will find below :
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';

Change it to below:
$config['permitted_uri_chars'] = 'a-z 0-9~%\.\:_\-';

Now our problem fix. The application run ok.