Codeigniter Redirect — The URI you submitted has disallowed characters

前端 未结 3 602
无人共我
无人共我 2020-12-03 10:47

When i\'m trying to redirect to other website, i receive this error:

A PHP Error was encountered

Severity: Warning

Message: parse_url(/%22**<

相关标签:
3条回答
  • 2020-12-03 11:31

    CodeIgniter checks all URI segments for disallowed characters. This happens by white listing allowed characters. Which ones are allowed can be checked in /system/application/config/config.php in the $config['permitted_uri_chars'] variable. permitted_uri_chars are the characters that CodeIgniter accepts in your URI.The default value is set to something like.

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

    By default only these are allowed: a-z 0-9~%.:_-

    Leave blank to allow all characters -- but only if you are insane.

    %22 comes for ".You can add this in permitted_uri_chars list.

    0 讨论(0)
  • 2020-12-03 11:45

    Try this may help but is not recommended, in your application/config/config.php change:

    $config['permitted_uri_chars']  = ''; #keep it blank to allow all characters
    $config['allow_get_array']       = TRUE;
    $config['enable_query_strings'] = TRUE;
    
    0 讨论(0)
  • 2020-12-03 11:49

    In my case it was a mal-formed URL.

    It was like mydomain/route&param=1

    Be aware that it should have an interrogation character instead of an "&" at the first parameter. So it should be like this: mydomain/route?param=1&other=2&another=3

    0 讨论(0)
提交回复
热议问题