I want to hide the download folder location so that when the user downloads a file he cannot see the location. I think this can be done using an .htaccess file but how do I
What you are going to want to do is have the user directed to fake_url.php and then rewrite that URL to a different file - real_url.php. This effectively renders the real_url.php as hidden because the user is unaware of the redirect happening in your .htaccess file.
RewriteRule fake_url.php(.*)$ real_url.php?$1 [L,QSA]
In your real_url.php, you can read the parameters passed through the redirect and then use something similar to readFile() to send the appropriate file back to the user from within real_url.php
So the user will only see the URL -
https://my-secret-site/download.php?file=file_to_download
And in your real_url.php you'll know what file was requested by inspecting the $_GET['file'] parameter.
The actual location of the files that the user is downloading does not matter anymore. All downloads go though fake_url.php and only that script needs to know the real location of the downloads folder.