merhaba,
Yönlendirme olayı mevcut file_get_contents yerine curl kullanın

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);