title: Curl Redirect: Why FOLLOWLOCATION doesn't follow right DOMAIN
body: <p>I'm trying to scrape a website but the page I tried to scrape contains a redirect to another page.I put FOLLOWLOCATION parameter on curl but I arrive on a url <a href="http://localhost/....pageredirected.php" rel="nofollow noreferrer">http://localhost/....pageredirected.php</a> and so on </p>
  
  <p>The problem is that redirect works but DOMAIN is not right (because it is mine not scraped page). Here is code:</p>
  
  <pre><code>&lt;?php
  // create a new CURL resource
  $ch = curl_init();
  
  // set URL and other appropriate options
  curl_setopt($ch, CURLOPT_URL, "http://voli.govolo.it/etape1.cfm?ref=2008052701&amp;destination=484&amp;Provenance=320&amp;Date_Depart=11/9/2010&amp;Date_Retour=18/9/2010&amp;AllerRetour=1&amp;Adultes=1&amp;ENFANTS=0&amp;BEBES=0&amp;dated=110910&amp;dater=180910&amp;TypeClasse=0&amp;langue=it");
  curl_setopt($ch, CURLOPT_HEADER, true);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);    
  
  // grab URL and pass it to the browser
  $esito = curl_exec($ch);
  print_r(curl_getinfo($ch));
  echo $esito;
  // close CURL resource, and free up system resources
  curl_close($ch);
  ?&gt;
  </code></pre>
  
  <p>page will be redirect is etape1.cfm TO etape2.cfm but I get 404 Error because I see <a href="http://localhost/scraping/etape2.cfm" rel="nofollow noreferrer">http://localhost/scraping/etape2.cfm</a>?... and not <a href="http://voli.govolo.it/etape2.cfm" rel="nofollow noreferrer">http://voli.govolo.it/etape2.cfm</a>?...</p>
  
  <p>Why FOLLOWLOCATION doesn't follow right DOMAIN (<a href="http://voli.govolo.it" rel="nofollow noreferrer">http://voli.govolo.it</a>) ?</p>