Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have IIS 7 on Windows Server 2008, with PHP support (5.3.15)

I have noticed a difference compared to an Apache 2 environment, with the content of PHP variable $_SERVER['REQUEST_URI'].

Basically, on Apache we get exactly the same content as in the requested URL, but with IIS the URL seems already partially decoded ("+" signs instead of spaces are unchanged, but %XX characters get already decoded in REQUEST_URI when not in query string part).

Examples:

Given URL my.server.com/index.php/test%E9+test, $_SERVER['REQUEST_URI'] contains:

  • index.php/testé+test on IIS <=== I would like this to be index.php/test%E9+test
  • index.php/test%E9+test on Apache

Note that given URL my.server.com/index.php?param=test%E9+test (the encoded characters are in a "real" query string), $_SERVER['REQUEST_URI'] contains:

  • index.php?test%E9+test on IIS
  • index.php?test%E9+test on Apache

Is there some kind of server setting or web.config switch to prevent "auto-decoding" of encoded characters outside the query string?

EDIT

BTW, IIS for some unknown reason, seems to decode %XX characters as if they were in some ISO-xxx encoding, not UTF-8.

share|improve this question
    
Agavi seems to force URL parameters to be considered as a query string by IIS by adding a '?' in web.config. See trac.agavi.org/ticket/1265 I will look at this closer. –  Frosty Z Jan 23 '13 at 15:56
    
    
Finally found my answer on the 2nd link (serverfault.com/questions/33375/iis7-url-rewrite-and-symbols) –  Frosty Z Jan 23 '13 at 17:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.