Fork me on GitHub

Restrict file downloading from direct link?  Bottom

  • I'm running Apache. I have some files that are made available for downloading using the Downloads module. What I'd like to do is block downloading unless they are actually on the site, and downloading from the links there, not from a link outside the website. Is there a way to do this?



    Edited by mesteele101 on Jul 09, 2011 - 08:14 PM.
  • I think the Downloads module supports placing your downloadable files above the web root.
  • I've been through all the settings in Downloads v2.4 and I didn't see anything. I found this link that deals with this using WordPress. Is there a chance it will work with Zikula?

    Limit Downloading
  • maybe you can use something like this:

    Code

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mysite.com [NC]
    RewriteRule \.(zip|rar|doc|xls)$ http://www.mysite.com/accessdenied.gif [NC,R,L]


    Create an .htaccess file with the above code and place it in your downloads folder. Remember to change 'mysite.com' to your site domain and edit the list of allowed files also.

    The purpose is to prevent hotlinking by checking the referrer.

    If you google 'prevent hotlinking' you will find many articles regarding this topic
  • That worked. I thought there would be more to it then that. I bwas thinking that they used the URL from the downloads that they would bypass the check. However it does't seem to be a problem using the download module.

    Thanks...
  • 0 users

This list is based on users active over the last 60 minutes.