bu kodda işini görür ;
$baslik = get_headers("http://www.domain.com/filedownload.php?id=12323", 1);
echo "$baslik['Location']";