CURL gives HTTP/1.1 302 Moved Temporarily
$ua = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.A.B.C Safari/525.13';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://...........");
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch1, CURLOPT_POST, true);
curl_setopt($ch1, CURLOPT_HTTPHEADER, array('Accept: Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11'));
$result = curl_exec($ch1);
Output:
HTTP/1.1 302 Moved Temporarily Content-Length: 0 Connection: keep-alive Date: Mon, 03 Jul 2017 12:23:55 GMT Set-Cookie:AWSALB=ZBxF0OO7JHWtHtsbAUVLo1a2Y7GQ1KTxIaMml+1UFTDK2UL7V6Xm8FIU1mWeCDZDtYvQ0emHLPLOtWpli +6pqFbYe+ulWPA8SBqeM/n5S9x0ScxYTGVsUeDixyuf; Expires=Mon, 10 Jul 2017 12:23:55 GMT; Path=/ Server: nginx/1.8.0 Location: https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx X-Cache: Miss from cloudfront Via: 1.1 ea5d711fdce750991b725e09c07704b0.cloudfront.net (CloudFront) X-Amz-Cf-Id: rVytkGKHVM628Zh3WFSohHlVdb-6XXZX-cXlQkvtRSeDCZN95s9Guw==