Home>

nginx decodes the characters in the uri and passes them to fastcgi. Generally, it does not matter.My search term contains backslashes.Encoded address

/search/madmanfoo%2flovesong /

The address that nginx passes to php becomes,I used pathinfo so couldn't get the correct result

/search/madmanfoo/lovesong /

I searched the nginx official website and found no configuration that prevents automatic decoding.I really do n’t want to re-encode,From finding a similar post,Seeing the sample can only be re-encoded,It is said that this is the official suggestion.In order to maintain the beauty of the address, only the backslashes that affect pathinfo are re-encoded.

$keyword=urlencode ($keyword);
$keyword=str_replace (array ("%2f", "%2f"), "%252f", $keyword);
  • Previous Hosting Process (vshostexe) in C # IDE VS2005
  • Next Analysis of closures (anonymous functions) in PHP