Forum Replies Created
-
AuthorPosts
-
Dan
ParticipantAfter 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.Dan
ParticipantSo 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
Dan
ParticipantHas 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 triedlocation / { 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.
-
AuthorPosts