I have images\*.png files and auto_scripts\*(.php|.bat) files in my root directory.
I want to restrict direct access of files and folder listing.
so far I have done,(in httpd-vhosts.conf)
<Directory C:/MyVirtualHost>
Options FollowSymLinks Includes ExecCGI
Require all granted
</Directory>
to restrict folder listing via URL (ie. www.mywebsite.com/includes/)
But I do not know how to restrict file access, like,
www.mywebsite.com/includes/sensitive_script.php
www.mywebsite.com/includes/private_photo.jpg
I do not understand the .htaccess file and tag, provided in other Stack Overflow's solution. Because it either allows both PHP and URL access (or) denies both access.
Help me to deny file access from URL, but not from PHP and HTML in root directory. Ask me for any clarification. I'm out of help here.