title: I am getting "Requested URL not found..." error with cURL. Any ideas?
body: <p>So I am posting data to another system and am wanting to retrieve the "redirection url" that the system responds back with and redirect the user after 2 seconds but I get: </p>
  
  <blockquote>
    <p>The requested URL /somescript.aspx was not found on this server.</p>
  </blockquote>
  
  <p>Any idea what I am doing wrong?  Or is there something else at play?</p>
  
  <pre><code>&lt;?php 
  $strURL = 'http://someplace.com/somescript.aspx'; 
  $fields_string = implode('&amp;', (array)$_SESSION['apply']);
  
  $resURL = curl_init(); 
  curl_setopt($resURL, CURLOPT_URL, $strURL); 
  curl_setopt($resURL, CURLOPT_POST, true);
  curl_setopt($resURL, CURLOPT_POSTFIELDS, $fields_string);
  curl_setopt($resURL, CURLOPT_HEADER, TRUE);
  curl_setopt($resURL, CURLOPT_FOLLOWLOCATION, FALSE);
  $response = curl_exec($resURL); 
  $RedirectLocation = curl_getinfo($resURL, CURLINFO_EFFECTIVE_URL);
  
  unset($_SESSION['apply']); ?&gt;
  &lt;script type="text/javascript"&gt;
  $(function() {
      setTimeout(function() {
          window.location.href = "&lt;?php echo $RedirectLocation; ?&gt;";
      }, 2000)
  });
  &lt;/script&gt;
  </code></pre>