download/media protection not working


I have finally got everything else working on the membership plugin except the downloads/media protection function.

I am setting up my membership site so that different memberships have bonus ebook rewards for signing up. They would be able to access a page with all the ebook formats upon registering for a plan; the link to this page would be available on the "welcome" page that they are routed to after paying. I will be hiding each bonus link under a shortcode for that memebership plan, but am leaving a sample link open now for you to test.

Website testing page:

Try to access the page for the book. I want the registered members to be able to access this main page so they can choose the ebook format that is best for them and download the book. Of course, the page, "testdownload.html" should be masked as well as the download links.

I have two questions:

Question 1: How to get it working at all. Using the default original URL of:

Set the masked URL to:

Set protected groups to:


These are different bonus downloads to be set as gift for paying members.

I have only two access levels:

1. Visitors (which are strangers with no subscription or membership)
2. Members (which are paying members)

Download group settings:
Visitors: negative rules for all download groups
Members: positive rules for all download groups

Neither setting works! Whether in the negative or the positive, whether a visitor or a member, you can still see the real URL as listed above.

Question 2: How to change the real directory to one of my choosing. It is very messy for me to use the default (unchangeable) setting in Membership: the uploads folder. I need to keep my e-books and classes in a masked folder of their own. How do I set this?

For your convenience, I have created a test member that should be able to download a test pdf from any link on the masked page:

User name: iPhone
Password: i

  • aliyah_marr

    Hi Vaughan,

    I was trying to not use the standard WP uploads folder. Wouldn't using the media uploader put all my files inside the same folder as all the images I upload for the regular website? Seems messy and a bit insecure to me.

    Isn't there a way to get the masked URL working? Seems that if I could change the default folder and get this function to work, it might be the best option for me.

  • aliyah_marr

    Dear Vaughan,

    Let me clarify my question. I am trying to mask the download URL of my PDF books. I understand now that the default WP uploads folder cannot be changed, but I cannot get the masking function to work as described in the manual. Regardless of whether you are logged in as the test member iPhone (see my question above), or not logged in at all, the real URL is showing. (I am testing it by logging out as Admin)

    According to the manual there are 3 ways to protect the URLs of downloadable media:

    1. Masking the URL (my preferred method)

    2. Protecting the media at the time of uploading the file (this is not optimal for me, as the files are already uploaded)

    3. Protecting the URL group.


    • It seems to me that your answer applies to method # 2 above, not to the other two methods as outlined in the manual.

    • I am trying to protect my download media from being seen by non-paying members.

    • In method #3, protecting the URL group, exactly how is this method used? What does the non-paying member see? And the paying member? Could anyone copy and paste this URL in to see content if not logged in?

    Perhaps I can use the URL group protection, but you are telling me that ALL the files have to be uploaded via the media loader in WP? That seems to be what Method #2 does, and it isn't defined that way in the manual. It seems to me that the protected URL group function must provide a different way to protect media than the other two, otherwise why program it in the Membership plugin in the first place?

    Below is the masked Downloads section of the manual:

    Downloads / Media
    The Membership plugin is one of the only membership plugins for WordPress which allows you to protect your media uploads. You can even mask a specific URL to prevent direct access. This is great for downloads like PDF eBooks, JPEG files, MP3 files, Flash video files, source code files or perhaps your own WordPress plugins and themes.

    Figure 2.16 shows a sample of the settings under the “downloads media” tab. You’ll notice that there are three options for protecting media uploads:

    13. Basic - Masks your media directory but leaves any filenames the same.

    14. Complete - Masks the media directory and changes the image filename as well.

    15. Hybrid – This is for use if you are using a host or server that has a problem with the system (such as some installs of nginx). Check with your hosting provider to see if this method may be required for your site.

    Membership 3.0 Documentation Page 26 Of 79
    Figure 2.16
    Membership 3.0 Documentation Page 27 Of 79
    ?After the three protection options, you’ll notice the URL where your protected media uploads will be located. Below that, you’ll have a place to input the URL which your users will see in their browser in place of the true URL where your media is located. For example, if your media uploads are located in this directory...

    ...and you choose this as the masked URL...

    ...the above URL is all your users will see when they access any of the content under this directory:


    My Welcome page's link to The Way of Love book remains the original unmasked version no matter what I do.

  • Vaughan


    sorry for the delay.

    no, as I have said previously, membership will only protect/mask the urls if the files are uploaded via the WP media uploader.

    I don't know of another way of doing it. maybe with some tricky htaccess to protect the folder. but i don't think you can mask the url without some heavy customizing of the script to fetch the files using absolute path & then create a downloader script to serve the files to the browser using header() functions. this would be difficult.


  • Tyler Postle

    Hey Aliyah!

    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:

    Protecting content has never been easier :slight_smile:

    If you have any questions we are more than happy to help!

    Have a great rest of your day.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.