How to turn off open directory listing on webpage

WhiteKnight

Platinum Member
May 21, 2001
2,952
0
0
I'm sure that there is a thread about this but I can't figure out what to search for. I tried "directory listing" and a few others but couldn't find what I'm looking for.

I have some webspace on my grad school department's server and I'd like to put up some info. How do I make it so that directory listing is not available? i.e. if I have a bunch of files in www.site.com/me/files, you can't just see the entire file list by going to that address (you have to know the file name or have a link to it). Some people suggested that I could just put a blank index.html file in there, and that works, but I know that there is a better way to do it. I don't have much web design experience but I am guessing that I don't need it anyway. Can anyone help me out? Thanks.
 

yllus

Elite Member & Lifer
Aug 20, 2000
20,577
432
126
1. Create a textfile called .htaccess on your local machine
2. Open it up in Notepad.
3. Put the following text in it, and nothing else: Options -Indexes
4. Upload file .htaccess to the directory you wish to become unbrowsable.
 

Bassyhead

Diamond Member
Nov 19, 2001
4,545
0
0
Sometimes the serving application itself will have an option to turn directory listing on/off.
 

vi edit

Elite Member
Super Moderator
Oct 28, 1999
62,484
8,345
126
Open IIS, do a properties on the site, uncheck "Allow Directory Browsing".

/me dons flame repellent suit to fend off the *Nix Nuts.
 

Heisenberg

Lifer
Dec 21, 2001
10,621
1
0
Originally posted by: vi_edit
Open IIS, do a properties on the site, uncheck "Allow Directory Browsing".

/me dons flame repellent suit to fend off the *Nix Nuts.
/me fires up flamethrower to burn right through that pansy Nomex crap
 

WhiteKnight

Platinum Member
May 21, 2001
2,952
0
0
Originally posted by: yllus
1. Create a textfile called .htaccess on your local machine
2. Open it up in Notepad.
3. Put the following text in it, and nothing else: Options -Indexes
4. Upload file .htaccess to the directory you wish to become unbrowsable.

Thanks! That worked. However, when I connect using SSH, I can't see the .htaccess file once it's uploaded. Is there a setting somewhere that's hiding it?
 

fs5

Lifer
Jun 10, 2000
11,774
1
0
Originally posted by: WhiteKnight
Originally posted by: yllus
1. Create a textfile called .htaccess on your local machine
2. Open it up in Notepad.
3. Put the following text in it, and nothing else: Options -Indexes
4. Upload file .htaccess to the directory you wish to become unbrowsable.

Thanks! That worked. However, when I connect using SSH, I can't see the .htaccess file once it's uploaded. Is there a setting somewhere that's hiding it?

yeah the .
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: WhiteKnight
Originally posted by: yllus
1. Create a textfile called .htaccess on your local machine
2. Open it up in Notepad.
3. Put the following text in it, and nothing else: Options -Indexes
4. Upload file .htaccess to the directory you wish to become unbrowsable.

Thanks! That worked. However, when I connect using SSH, I can't see the .htaccess file once it's uploaded. Is there a setting somewhere that's hiding it?

ls -a