Welcome Guest, Not a member yet? Register   Sign In
how to use $config['uri_protocol'] = "PATH_INFO"; with nginx server
#1

[eluser]nil_php[/eluser]
Hi friends,

I am facing problem with nginx server.
I want to use $config['uri_protocol'] = "PATH_INFO"; but when I am using this it is showing me 404 error message. It is working with $config['uri_protocol'] = "REQUEST_URI";

But my few urls are like site.com/search/?a_aid=123456 for tracking a_aid on some other sites I need such urls.

If I used the site.com/search/?a_aid=123456 such url with $config['uri_protocol'] = "REQUEST_URI"; then it is showing the message "The URI you submitted has disallowed characters."

Can anyone help me to find out how to use PATH_INFO as uri_protocol or site.com/search/?a_aid=123456 with nginx.
#2

[eluser]nil_php[/eluser]
This issue is solved now.
Go to system/libraries/URI.php & replace the line

Code:
if ( ! preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", $str))

with

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

Also change the permitted_uri_chars value in config.php to
Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%\.\:_\-';

And use the uri_protocal as,

Code:
$config['uri_protocol'] = "REQUEST_URI";




Theme © iAndrew 2016 - Forum software by © MyBB