cakephp #IndexIgnore

I'm using cakephp. It's set up with standard .htaccess mod rewrites.
I don't want files listed when someone types in www.mysite.com/img.
In non cakephp sites i just drop this into my .htaccess file and it works like a charm.

<Files .htaccess>
order allow,deny
deny from all
</Files>

#IndexIgnore *
#Options -Indexes


Although it's not working.  ... here is the root .htaccess as is...

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

<Files .htaccess>
order allow,deny
deny from all
</Files>

#IndexIgnore *
#Options -Indexes
koskajAsked:
Who is Participating?
 
koskajConnect With a Mentor Author Commented:
what a moron i was... i had the #IndexIgnore * commented out.
0
 
Mark BradyPrincipal Data EngineerCommented:
Create an index.php or index.html file and place it in each folder you have. When somemone tries to access a folder directly, by default the index file will be displayed. You could have the index.html or .php file redirect the browser to the default webpage if a user tries to navigate to the folder contents.
0
 
xardas2010Commented:
You can create a .htaccess file in your /img/ directory an write there "Deny from all". Should work.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.