• Trobee

    (@trobee)


    Hi,

    I am currently running a Multisite install of wordpress and I am using More Privacy Options to set the privacy of each sub-site. However, I have recently uploaded some pdf’s with the media uploader and they are not being affected by the privacy rules, allowing anyone to access them. Does anyone know of a fix to this, or another plugin that has the functionality I require

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Trobee

    (@trobee)

    I have been looking at using .htaccess to password protect the folder containing these media files, but ideally I would like to use a wordpress login, so logged in users can get at the resources but logged out users cannot.

    Thread Starter Trobee

    (@trobee)

    So, I currently have this in my .htaccess file in my uploads directory

    IndexIgnore *
    Options +FollowSymlinks
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !mywebsite\.com [NC]
    RewriteRule ^(.*)$ https://mywebsite.com/wp-login.php?redirect_to=wp-content/uploads/$1 [NC,L]

    So if you try to access something from the uploads folder using a link from another site it will redirect you through through the login page, with the redirect pointing back to the resource. This all works fine with the code, my problem is redirecting links typed into the browser address bar, because if I remove “RewriteCond %{HTTP_REFERER} !^$” from the file and try to access a resource, and I am already logged in, I get a redirect loop that means no pages get displayed.

    Can anybody help me?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Privacy for media items’ is closed to new replies.