Q:

forward a url using php dynamically using curl

im using a url to download a file.

for example
This url is downloading file
url:www.abc.com/get.php?file=1

how to redirect the same url to another side like xyz.com
url:www.xyz.com/get.php?file=1
im using this way but its not execuiting and downloading the file from new url
$url="www.abc.com/get.php?file=1";

$url=str_replace("abc","xyz",$url);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);    
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_exec($ch);
curl_close($ch);

A:

Assuming the PHP on xyz handles the downloading of the file then you shouldn't need curl.
$url="www.abc.com/get.php?file=1";

$url=str_replace("abc","xyz",$url);

header("Location: $url");

