I have the following structure for my filesystem
public_html
css/
doc/
img/
js/
lib/
*.php
private_html
miscellaneous/
The document root in for my website is set in /etc/apache2/site-available
as
DocumentRoot /var/www/public_html
Currently this allows users to direct access to files from the url like mysite.com/css/custom.css
and mysite.com/lib/...
What is the best way to prevent direct access to these files? Should I just restructure the filesystem like this:
public_html
*.php
private_html
css/
doc/
img/
js/
lib/
miscellaneous/
And update the paths of the included scripts in the php files?
.js
and.css
etc. in the HTML, it's still downloaded by the user and he can extract it from the page source.