Are you tired of those pesky non-logged in users downloading content on your precious WordPress website? Here’s a simple solution using the power of the .htaccess file!
RewriteBase / RewriteCond %{REQUEST_FILENAME} ^.*(png|pdf|jpeg|jpg|gif|bmp|pdf|doc)$ RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC] RewriteRule . – [R=403,L]