Restrict access to file, but allow links

I have a zip file uploaded on my site. I want to restrict access so that people cannot type the URL directly into the address bar, but I want it to be able to download if they click on a link to the file on my site. In other words, if the referrer URL contains https://mydomain.com, let the file download, otherwise, restrict access. Can I do this with the .htaccess file, and if so how? Let me know if you need any clarification. Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.