Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact
You are here: Home

Dan

  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • December 13, 2021 at 2:47 am in reply to: Protecting Files/Media #23379
    Dan
    Participant

    After a server restart it seems to be working fine now with PHP8.1
    Thanks!
    I am however not able to preview the file in the media library when logged in as admin, though I think that has more to do with this plugin as I am not able to see the posts as well, only users with the proper membership tag are bale to see, but admins are not. I’ll play with the settings.

    December 5, 2021 at 1:58 am in reply to: Protecting Files/Media #23341
    Dan
    Participant

    So in my case for nginx I wrote this for my site config. This will block someone from having direct access to the file and they cannot download it, and they will only be able to access it if the website serves them the post (so if it’s a member only post, only members can see the file). For now this is the functionality I am looking for, and it only needs the config to be edited without the need for additional scripts.

    
    	# Hotlink protection
    	location ~ ^/wp-content/uploads/(.*) 
    	{
    		valid_referers YOURSITEHERE.com www.YOURSITEHERE.com;
    		if ($invalid_referer) 
    		{
    			return 403;
    		}
    	}
    

    Hope someone else finds it useful

    December 4, 2021 at 11:46 pm in reply to: Protecting Files/Media #23340
    Dan
    Participant

    Has anyone had any luck with getting this to work on nginx? Running nginx and php8.0 I change the nginx config to match the rewrite rule for the htaccess file
    I tried

    
    location / {
      if (-e $request_filename){
        rewrite ^/wp-content/uploads/(.*)$ /dl-file.php?file=$1 last;
      }
    }
    

    and

    
    location ~* /(?:uploads|files)/* {
        rewrite /wp-content/uploads/(.*)$ /dl-file.php?file=$1 last;
    }
    

    And only get dl-file.php downloaded when trying to access the media file as if the FastCGI server isn’t running, however it is and WordPress itself isn’t having any issues.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
Next Page »

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy