I cannot resolve a redirect in curl with PHP. I call the URL https://data.fei.org/Horse/Search.aspx, but as result I get a login site. This occurs not on all server. In the test environment it works fin, but not production server. That's my curl init
$url = "https://url.org/Search.aspx";
$checkFile = tempnam('/tmp', 'cookie.txt');
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_PROXY, "my.proxy.com:8080");
curl_setopt($ch, CURLOPT_PROXYPORT, 8080);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/x-www-form-urlencoded'
));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_COOKIEFILE, $checkFile);
curl_exec($ch);
Any idea why I'm redirected on production but not on test environment?