Hi
On my site (call it www.mysite.com) I have a single directory, /content, into which I place all my CSS, JS, Images, PHP includes and other code snippets that my site, hosted by Apache, needs.
I want to allow my site (php-based) to operate normally, but wish to prevent anyone from directly accessing anything in my /content folder (ie using a browser url such as www.mysite.com/content/mylayout.css to view the content of my css file).
I've setup an .htaccess in my /content folder, which contains the following:
AuthType Basic
AuthName "Access Site Content"
AuthUserFile /home/top/html/pass/.sitepwd
require valid-user
Options +Indexes
This asks for the usual username/password as I require (using the username and password in my .sitepwd file) on any such attempt to list the content of any file within my /content folder, but also when a visitor comes to my site as intended via my www.mysite.com/index.php.
I can't currently work out how to place an .htaccess in my /content folder that ensures no challenge when my php files are being executed normally as a visitor navigates my site.
I'm probably missing something really simple here as to how to do this - but for the moment I can't find a solution!
Any help gratefully appreciated!