SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Wizard
    Join Date
    Oct 2004
    Location
    Newport Beach
    Posts
    1,761
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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
    Upcoming Movies - Movie News. Updated Daily.
    Movie Trailers - Awesome trailer site. Nuff said.

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,680
    Mentioned
    20 Post(s)
    Tagged
    3 Thread(s)
    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
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Wizard
    Join Date
    Oct 2004
    Location
    Newport Beach
    Posts
    1,761
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    Upcoming Movies - Movie News. Updated Daily.
    Movie Trailers - Awesome trailer site. Nuff said.

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,680
    Mentioned
    20 Post(s)
    Tagged
    3 Thread(s)
    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
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2004
    Location
    Newport Beach
    Posts
    1,761
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    Upcoming Movies - Movie News. Updated Daily.
    Movie Trailers - Awesome trailer site. Nuff said.

  6. #6
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,680
    Mentioned
    20 Post(s)
    Tagged
    3 Thread(s)
    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
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  7. #7
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,680
    Mentioned
    20 Post(s)
    Tagged
    3 Thread(s)
    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
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  8. #8
    SitePoint Wizard
    Join Date
    Oct 2004
    Location
    Newport Beach
    Posts
    1,761
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    Upcoming Movies - Movie News. Updated Daily.
    Movie Trailers - Awesome trailer site. Nuff said.

  9. #9
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,680
    Mentioned
    20 Post(s)
    Tagged
    3 Thread(s)


    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •