php - restricting access to zip files from other domains with htaccess -
i running website has number of zip files in single folder.
i'd people able access these download links on website (which behind log-in) want make sure can't downloaded typing url of zip files directly.
so presume needs done htaccess - , sort of deny rule, exception of domain. correct?
right now, file contains (with actual domain replaced "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 env=locally_linked </filesmatch>
can shed light on why might not working?
i'm on shared host (dreamhost) :/ - i'm presuming doesn't make difference.
thanks.
i have similar using mod_rewrite
, use code
rewriteengine on rewritecond %{http_referer} !^$ rewritecond %{http_referer} !^http(s)?://(www\.)?yourdomain.com [nc] rewriterule \.(zip)$ - [nc,f,l]
Comments
Post a Comment