I need to deny public users to see the js frameworks we use in our website.
I have Apache 2.x version with php and js.
First my question is, is it recommendable? I mean, wouldn't denying access to the directory will also block Apache to parse the framework and use it?
Second, how can I achieve it? I have tried with
RedirectMatch 404 /var/www/html/js/.* example.com
following this guide: https://alvinalexander.com/web/apache-redirectmatch-examples-wildcard-301
Also I have tried with a .htaccess file in /js directory with just deny from all
on it and even a <Directory "/var/www/html/js"> </Directory>
with Options -Indexes
and deny from all
but got no luck.
What is the correct way of doing this?
EDIT
This is part of a pentest result that has been done to my server and the auditors are saying the public access to /js directory and frameworks within it is a security problem so, I'm trying to look for a way to deny access or well, find a way to justify the access to this directory