I am running a website which has a number of zip files in a single folder.
I'd like people to be able to access these from download links on the website (which will be behind a log-in) but I want to make sure that they can't be downloaded by typing the URL of the zip files directly.
So I presume this needs to be done with htaccess - and some sort of deny all rule, with an exception of my domain. Would this be correct?
Right now, my file contains this (with my actual domain replaced by "domain"):
SetEnvIfNoCase Referer "^http://domain.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://domain.com$" locally_linked=1
SetEnvIfNoCase Referer "^http://domain.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://domain.com$" locally_linked=1
SetEnvIfNoCase Referer "^$" locally_linked=1
<FilesMatch "\.(zip)$">
Order Allow,Deny
Allow from env=locally_linked
</FilesMatch>
Can anybody shed any light on why this might not be working?
I'm on a shared host (Dreamhost) :/ - but I'm presuming this doesn't make much difference.
Thanks.