cURL response headers
I am developing php application with cURL library.

I would like to get redirect url (in case 301 or 302 http code). In Windows it is simple, I just need to call curl_getinfo($ch). This methods returns associative array with redirect_url, which I am using later.

I have problem when I moved my application to linux server. Such method (curl_getinfo) returns array too, but there is no "redirect_url" index. I though I could try to read headers as a string. I set 

    curl_setopt(CURLOPT_HEADERFUNCTION, callback) 

and save response headers as a string. Then I use simple parser to get fields I am interested in. But now I have another problem. Redirect url (http header LOCATION) returns relative url (whereas in Windows it is absolute).

Why there are differences in windows cURL and linux one? What can I do to make this application resistant to OS changes? And finally, how can I get this field (redirect url) as an absolute url in linux.

Thanks for your help :)
cURL response headers
===

I am developing php application with cURL library.

I would like to get redirect url (in case 301 or 302 http code). In Windows it is simple, I just need to call curl_getinfo($ch). This methods returns associative array with redirect_url, which I am using later.

I have problem when I moved my application to linux server. Such method (curl_getinfo) returns array too, but there is no "redirect_url" index. I though I could try to read headers as a string. I set 

    curl_setopt(CURLOPT_HEADERFUNCTION, callback) 

and save response headers as a string. Then I use simple parser to get fields I am interested in. But now I have another problem. Redirect url (http header LOCATION) returns relative url (whereas in Windows it is absolute).

Why there are differences in windows cURL and linux one? What can I do to make this application resistant to OS changes? And finally, how can I get this field (redirect url) as an absolute url in linux.

Thanks for your help :)