Home » Php » Codeigniter: URI you submitted has disallowed characters

Codeigniter: URI you submitted has disallowed characters

Posted by: admin November 30, 2021 Leave a comment


My URL is:


When I remove = then it works fine.

I have this in config.php

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


The URI you submitted has disallowed characters.

How can I allow = or == signs in URI?

I have tried it by changing this:

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-='; // added = sign at the end

In /project-folder-name/application/config/config.php configure this variable:

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

it also works for @ character


change in config.php file

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


$config['enable_query_strings'] = TRUE;

It works for me. Try it yourself!


In CI open directory at
project-folder-name/application/config/config.php and configure the variable $config['permitted_uri_chars']:

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

This will work for all special characters


first of all you have to encode your id that is pass in url, then in controller you have to decode the id.

<a href="<?php echo base_url()?>Cinvoice/imei_invoice/<?php echo base64_encode($invoice_list['invoice_id']); ?>" class="btn btn-danger btn-sm" data-toggle="tooltip" data-placement="left" title="Final Invoice By Ware House">Primary Order</a>


when you call fuction that is in library

$content = $CI->linvoice->get_imei(base64_decode($invoice_id)); 


i have got this in address bar


change in config.php file

use this

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

its working fine


In my CI version 3.11 i solved by this :

in application/config/config.php i changed

$config[‘permitted_uri_chars’] = ‘a-z 0-9~%.:_\-‘;


$config['permitted_uri_chars'] = '';

and problem solved.

My URL was something like this : example.com/product/45/kotlin_toturial(by_avasam.ir) _in_99_lessons



I have changed the config.php file

$config[‘permitted_uri_chars’] = ‘a-z 0-9~%.:_-=&’;

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


$config['enable_query_strings'] = TRUE;