I found the fix. In my front controller page (index.php) I had to add the
following code:
if (isset($_SERVER["IIS_WasUrlRewritten"])) {
$_SERVER['REQUEST_URI'] = $_SERVER["UNENCODED_URL"];
}
Does anyone see any potential problem with this fix? I found the above code
from the following page:
http://www.tomick.pl/przyjazne-linki-zend-framework-w-iis75,515,11,05,2009.html
http://www.tomick.pl/przyjazne-linki-zend-framework-w-iis75,515,11,05,2009.html
Didn't understand a single word, but it looked promising, so I gave it a
try.
-Henry
humansky wrote:
>
> I think you are on to something. IIS didn't have 'PATH_INFO' but it
> did have the following variables:
> ["HTTP_X_ORIGINAL_URL"]=> string(23) "/index/index/key1/key2/"
> ["REQUEST_URI"]=> string(23) "/index/index/key1/key2/"
> ["UNENCODED_URL"]=> string(25) "/index/index/key1//key2//"
> So somehow "UNENCODED_URL" gets converted to either "REQUEST_URI" or
> "HTTP_X_ORIGINAL_URL". And ZF is using either REQUEST_URI or
> HTTP_X_ORIGINAL_URL. Does anyone know how to prevent IIS from
> rewriting the URL?
> Thank you,
> Henry
> On Aug 27, 2009, at 9:38 AM, drm wrote:
>
>> I think IIS might somehow normalize double slashes to single ones,
>> even
>> before ZF gets a touch at it. You might try reading out PATH_INFO from
>> $_SERVER to see if that is actually the case. If so, you might need to
>> figure out how to get IIS not to touch it.
>>
>> It is a wild guess, though.
>>
>> Henry Umansky wrote:
>>> Hello,
>>> I had to convert a ZF application that sat on a Linux/Apache
>>> machine to a Windows 2008/IIS7 machine. Everything seemed to work,
>>> with one minor exception. Using the LAMP stack, if the URL had a
>>> blank value, such as /index/index/key1//key2// then the PHP
>>> variables are blank:
>>>
>>> $key1 = $request->getParam ( 'key1' ); //$key1 == '' (blank)
>>> $key2 = $request->getParam ( 'key2' ); //$key2 == '' (blank)
>>>
>>> However, since I moved to IIS7, /index/index/key1//key2// gives me
>>> the following values:
>>>
>>> $key1 = $request->getParam ( 'key1' ); //$key1 == 'key2' (not
>>> desired behavior)
>>> $key2 = $request->getParam ( 'key2' ); //$key2 == '' (blank)
>>>
>>> Any thoughts on how to fix it? Could it be a php.ini issue?
>>>
>>> Thank you,
>>> Henry
>>
>>
>
>
>
--
View this message in context:
http://www.nabble.com/Problem-with-key-value-pair-in-URL-routes-tp25156539p25176852.html
Sent from the Zend Framework mailing list archive at Nabble.com.