En el .htaccess de la carpeta /public_html/downloads ponés "Deny from all"
Y hacés un archivo /public_html/download.php con lo siguiente
Código PHP:
<?php
session_start();
if (!$_SESSION['logueado']) { die ('Debés estar logueado para descargar archivos'); }
$archivo = $_GET['archivo'];
//cosas de seguridad...
if (strpos($archivo,'../') !== false || substr($archivo,0,10) != 'downloads/') die('Error en la ruta');
//dependiendo del tipo de archivo
header("Content-type: application/octet-stream");
//header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="' . basename($archivo) . '"');
readfile($archivo);
?>