title: How can I get the destination URL using cURL when redirect on JS?
body: <p>How can I get the destination URL page in cURL after JS redirect? This code is worked correct:</p>
  
  <pre><code>$url = 'http://google.com'; 
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
  curl_setopt($ch, CURLOPT_TIMEOUT, 120);
  $lastUrl = curl_exec($ch); 
  $lastUrl = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
  echo "Original: $url &lt;br&gt;Final: $lastUrl";
  exit;
  </code></pre>
  
  <p>but if use this URL <a href="https://www.industrialsafety.com/search_results_a/256.html?Search=brady+76801" rel="nofollow">https://www.industrialsafety.com/search_results_a/256.html?Search=brady+76801</a> Final URL is same, but it should be this <a href="https://www.industrialsafety.com/Brady-76801-Brady-GlobalMark2-Color-Cut-p/cc-76801by.htm" rel="nofollow">https://www.industrialsafety.com/Brady-76801-Brady-GlobalMark2-Color-Cut-p/cc-76801by.htm</a></p>