How to prevent people to see the top level directories?

Discussion in 'HTML & Website Design' started by M.K.Jackson, Jun 5, 2007.

  1. #1
    I remember theres a way to prevent people from seeing all the files displayed in a directory view if they type in www.mysite.com/folder/...currently they see a list of all the files contained so they can just donwload. I recall it being easy to fix but can't remember where to change it - does anyone knwo?
     
    M.K.Jackson, Jun 5, 2007 IP
  2. cckid

    cckid Peon

    Messages:
    139
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    the easiest way is to just create a blank index file.
     
    cckid, Jun 5, 2007 IP
  3. Monty

    Monty Peon

    Messages:
    1,363
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Or write this in the .htaccess file :

    Options -Indexes
    Code (markup):
     
    Monty, Jun 5, 2007 IP
  4. M.K.Jackson

    M.K.Jackson Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Awesome, that's what I was looking for, thanks :D

    Thanks for the tip about the blank index file, never thought about that :)
     
    M.K.Jackson, Jun 5, 2007 IP
  5. cckid

    cckid Peon

    Messages:
    139
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    No problem - that's what I used to do before I knew about .htaccess...quick and easy.
     
    cckid, Jun 5, 2007 IP
  6. nicheguy1

    nicheguy1 Peon

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I put this simple redirect to the page I want to use. You can change it quickly to what you want.

    <?php header("Location: http://www.online-resource1.com/videos.php");?>
    <p>If you're not redirected to the proper page in 5 seconds,
    <a href="http://www.online-resource1.com/videos.php" target="_top"><strong>Click
    Here</strong></a>.
    </p>
     
    nicheguy1, Jun 5, 2007 IP