How do I protect URL's (like PDF's)

I can't seem to figure out how to configure the plugin to protect URL's of specific files.

I have documents uploaded on the site. Some of these documents must not shown to certain member levels.

What I have done is add the media file to the protected group (I use basic protection). I have also assigned negative rule on this group in access levels. But when I paste the URL to this file in the browser it simply downloads.

Help appreciated thanks.

    Vaughan

    hiya

    thanks for posting.

    you will need to protect that location from hotlinking via htaccess.

    for instance if your files are located in wp-content/uploads/documents

    you would place a file called .htaccess inside the documents folder.

    the content of htaccess would be something like this >

    IndexIgnore *
    Options +FollowSymlinks
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain\.com/ [NC]
    RewriteCond %{REQUEST_URI} !hotlink\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx) [NC]
    RewriteRule .*\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx)$ http://yahoo.com/ [NC]
    
    order deny,allow
    deny from all
    allow from <YOUR SITES IP ADDRESS>

    it could need a few tweaks, but that's the base of it.

    that should then only allow people who click the link from that page on your site to download.

    hope this helps.

    thanks.

    Vaughan

    hiya

    sorry for the delay here.

    here's a step by step to protecting download urls

    #1

    goto Dashboard > membership > URL Groups

    create a new URL group (screenshot 1)

    make sure you add the masked download URL from #2 to the URL group.

    #2

    goto Dashboard > membership > options > downloads / media tab

    select 'complete' protection.

    check the masked URL leave as default.

    select the URL group you have just created (screenshot 2)

    #3

    goto Dashboard > membership > access levels

    add/edit your free level (or premium, depends on whether you use negative or positive rules) but the principle is the same.

    add the downloads to your negative rule (or whichever you use)

    then select the protected url group you just created (screenshot 3)

    #4

    when you add your media (or edit media)

    you should now be able to add it to the protected url group. (screenshot 4)

    that's it, now when you add the media and select the protected group, the url will be protected.

    note. super-admins & admins can always see the real URL, but other groups will be protected depending on their access levels.

    hope this helps

    thanks

    Tyler Postle

    Hey Vusis!

    Just in-case you haven't already heard, I'm going over some past related posts to let you know we've released a brand new powerful, super easy to use membership plugin. Offering a different approach and logic when compared to our already existing feature packed Membership plugin.

    Check out the full details here: https://premium.wpmudev.org/project/protected-content/

    Protecting content has never been easier

    If you have any questions we are more than happy to help! https://premium.wpmudev.org/forums/#question

    Have a great rest of your day.

    Cheers,
    Tyler