I am using .htaccess
to prevent user to access images through url.
Thanks to this question, I could prevent users to access .js
files.
RewriteEngine ON
RewriteRule ^frontend/assets/(?:js) - [R=401,NC,L]
However, when I applied the same rules in order to denied access to dir1
and dir2
, the access is only denied to images in directory dir1
.
RewriteRule ^frontend/assets/images/(?:dir1|dir2) - [R=401,NC,L]
Is there a way to handle this and prevent users to access files in directory dir2
as well ?