I want to prevent hotlinking of pdf files when a user is not logged in (with WordPress) and which begin with “restricted_”.
Currently I have the following .htaccess lines:
#RewriteEngine On
#RewriteCond %{HTTP_REFERER} !^(.*).oegn.at/ [NC]
#RewriteCond %{REQUEST_URI} !hotlink.(pdf) [NC]
#RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]
#RewriteRule .*.(pdf)$ http://www.oegn.at/ [NC]
Right now this prevents of hotlinking every .pdf file. I don’t how I can achieve my goal.
To check the file, you can do next:
Now just replace my rewriteRule with what you want.
If you have any questions, let me know.