Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 6 of 6

This is a discussion on directory help in the Shared & Semi-Dedicated forum
okay, i've got a directory on my server called "images" where i store all of my images... The problem i'm having is that when someone ...

  1. #1
    JPC Member
    Join Date
    May 2004
    Posts
    2

    directory help

    okay, i've got a directory on my server called "images" where i store all of my images... The problem i'm having is that when someone goes to http://www.muempire.com/images/ in their browser, they can see all the files that i have stored.

    I'm not sure if it's a security risk or not, but is there a way I can prevent people from viewing folders such as that?

  2. #2
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Make an empty file called index.html and upload it to your directory.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  3. #3
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Better yet, make a file called index.php, put this in it:
    PHP Code:
    <?php
    header
    ("Location: http://www.muempire.com/")
    ?>
    ...then upload it to your directory. This will redirect inquiring minds to your homepage.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  4. #4
    JPC Member
    Join Date
    May 2004
    Posts
    2
    thanks dude!

  5. #5
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Heh! PHP to the rescue!

    That works pretty good huh?

    I think I'm gonna replace all my empty index.html files with that...

    EDIT: Um... redirected to my homepage, of course.
    Last edited by Vin DSL; 05-21-2004 at 09:18 PM.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  6. #6
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    Another alternative is to put a file called .htaccess in that directory, and in that add the following:

    Options -Indexes

    This will cause an error page to be displayed that says that the directory listing is denied. Its not a pretty solution (although with a little more .htaccess tweaking you can customize the error page), but it does offer you the benefit of blocking directory access to any subdirectories of that directory without needing additional index.html/index.php files for each one.

    Alternatively, put the .htaccess file in your public_html directory and it will protect any directory in your entire site that doesn't have a default index page.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

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
  •