Stop directory being browsed?

Discussion in 'Security' started by mikeasro, May 6, 2010.

  1. #1
    I have a Flash mp3 player on my site and I keep the mp3's in another directory on the same site, If you look had enough in the source code you can see the directory address containing the mp3's.
    To stop people just browsing to the directory and having access to music my friend said I should just put a blank html page in the directory...... This seems logical and seems to work, Is this OK or is there ways to get around this method to show the contents of the directory?

    Thanks in advance
     
    mikeasro, May 6, 2010 IP
  2. Actaviosan

    Actaviosan Guest

    Messages:
    216
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'd do two things:
    insert a file named index.html in that directory that contains ABSOLUTELY nothing! this will prevent the directory files being listed.
    Secondly, I'd chmod the directory in a way that lets the requests be from the server-side only! That's if you're using a linux server.

    PM me if you need any further help.
     
    Actaviosan, May 6, 2010 IP
  3. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #3
    In your .htaccess file, place the following code:

    IndexIgnore *.*

    This tells Apache to ignore all file types for indexing.
     
    RHS-Chris, May 6, 2010 IP