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

Standard

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.

Advertisements

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

  1. Hey Imran,

    Just wanted to say thank you for the solution. I was moving a codeigniter installation to another server and was having exactly this issue. 3 days later and a lot less hair I’ve done it thanks to your solution 🙂

  2. Thanks.. It helped me a lot..
    I was googling for some times , tried some tricks but at last it helped me.. 🙂

  3. This solved my problem.
    It deserved time searching over Internet. I was lucky to found your code.
    Thank you for your knowledge.
    Keep up the good work!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s