[Solved] How to prevent users from accessing .pdf files untill they are not being redirect from any page of website by using .htaccess?


Issue resolved.
Thanks for your precious time.
Here is my code that I’m using in my .htaccess file.

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example\.com/ [NC]
RewriteCond %{REQUEST_URI} !hotlink\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov) [NC]
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]
RewriteRule .*\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov)$ http://example.com/ [NC]

Hope now you all understand that what I wanted to do.

solved How to prevent users from accessing .pdf files untill they are not being redirect from any page of website by using .htaccess?