Is there a CakePhp way to disable direct access to directories to visitors? I don’t want them to see files I have in my folders.
I’m using Cakephp 1.3, and it would be great to find a kind of htaccess solution in cake files.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use multiple solutions depending on your needs.
The htaccess solution you seem to be aware of. It means that you won’t be able to write something like < img src=”forbidden/directory/myImage.png” />. It might not be what you need.
The Media view. (link to the book). The book is quite clear on that point. The idea is that you can decide whether you want to serve/send a file to a specific user
If you just don’t want the user to be able to list the content of your directories (for images directories for example), you can add an empty index.html inside your directories and it will work just fine.