I want to restrict the file access via url and also I need to allow from html view page. My code is like this means
<img src="../webroot/images/logo.png" alt="logo">
The attacker simply go to inspect element and copy paste the url and get the original file from my server. Some images are user privacy so how can I prevent it. I just also tried this htaccess method but it restrict on both from url and also in html view page.
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://localhost$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://localhost/skypeclass [R,NC]