One Folder Not Listening to Options -Indexes

I have an htaccess file on a file server and have the htaccess file with Options -Indexes in the first level directory. All the folders in that directory show the Forbidden message when somebody tries to just open a directory, but one folder refuses to listen and instead lists all the files/folders inside.

What gives?

Thanks
Ryan

Ryan,

If that doesn’t work, DELETE that directory then add another directory (you can’t really be that attached to media1, can you?) and see what happens with that one.

Regards,

DK

Ryan,

That’s NOT a good sign, though! It’s dead wrong!

Try giving that directory a DirectoryIndex index.php index.html directive and include an index.php (or index.html) file that says to … er, leave - directory index forbidden?

Regards,

DK

Whoa!

Sorry for my late responses. I never got email notifications on any new responses. I’m going to try the file move tonight by making new directory, moving files, deleting old directory, and then renaming new directory.

Hopefully should work.

CHeers!
Ryan

:tup:

Regards,

DK

Here is a bit of the structure, the htaccess file has the options -indexes

/public_html/.htaccess

/public_html/media5/ (Forbidden when accessed)

/public_html/media1/ (Shows all the files in its directory)

I’ve even tried adding an htaccess with “options -indexes” only in it in the media1 folder like so:

/public_html/media1/.htaccess

Still lists the files.

Thanks
Ryan

*It looks like this folder got er, corrupted would be best word, when doing a cpanel transfer long ago. I had to CHOWN it a while ago to allow me to properly give the cpanel user permissions to it.

Ryan,

Where is the deviant directory (relative to the DocumentRoot) and how are you connecting to it? In other words, if that directory is being used as the DocumentRoot for an addon domain, its request will bypass the main domain’s DocumentRoot and its prohibition of directory listings.

IMHO, (1) the case you describe should not happen (if you’re requesting {DocumentRoot}/subdirectory) UNLESS you overrule the directory prohibition at a lower level (another .htaccess in the path or directory) and (2) you can ensure that the deviant directory complies by adding Options -Indexes in its .htaccess file.

Regards,

DK

I did all that and the folder still doesn’t like listening to Options -Indexes stated in the htaccess. Just shows off the files.

But it is now responding to FTP and all that. So everything seems fine, save for the fact that it is displaying when it should not be.

Ryan

Ryan,

I’m not sure how sensitive Apache is to having its directives comply with the case of the instructions (probably not at all - at least that seems to be the case with mod_rewrite) but I’d use Options -Indexes to be safe.

It’s quite likely that your CHMOD would prevent your ownership of the media1 directory as well as being allowed to upload files (.htaccess) to it. I know that I can often upload (FTP) to my online server only to discover that the file was not changed because the permissions were not set to allow the upload. Use cPanel’s File Manager to reset the permissions - that’s always worked for me (especially when FTP’s CHMOD doesn’t).

Regards,

DK