<!DOCTYPE html>
<html lang="ru">
<head>
<meta name="referrer" content="no-referrer" />
</head>
<?php
$base_url = 'https://cloud-api.yandex.net/v1/disk/public/resources/download?';
/**
* Ссылка на файл YaDisk
*/
$link = 'https://disk.yandex.ru/d/nss0Vsi2HPAX2w';
/**
* Формирование API ссылки
*/
$final_url = $base_url . 'public_key=' . urlencode($link);
$json = json_decode(file_get_contents($final_url));
$linkFile = $json->href;
echo '<script>document.location.href = "'.$linkFile.'";</script>';
?>
</html>