There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell display driver drivers email error excel explorer firefox firefox 3 game hard drive internet internet explorer itunes laptop lcd linux malware network networking nvidia outlook outlook 2003 outlook express partition printer problem ram router slow sound sprtcmd.exe trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: Browsing my website directories


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
martha.a's Avatar
Junior Member with 17 posts.
 
Join Date: Oct 2004
Location: Athens, Hellas
Experience: Beginner
13-May-2007, 02:37 PM #1
Solved: Browsing my website directories
(Sorry if I post on the wrong forum)

I have a site www[dot]mysite[dot]com and a directory in it "folder" for example.
When I browse the address www[dot]mysite[dot]com/folder/ I see the content of the entire directory.
Why is that?

I do not want this directory contents to be public.
Sequal7's Avatar
Computer Specs
Distinguished Member with 2,369 posts.
 
Join Date: Apr 2001
Location: Around the corner!
Experience: Including today?
13-May-2007, 04:52 PM #2
Your server has directory browsing on, you can turn it off.
If your host uses cPanel WHM, you can turn it off. Login to your cPanel user account, Select Index Manager

Or, no cPanel, Look for a .htaccess file in your www folder (or create one using notepad)

add this to it (or create this in notepad and save it as .htaccess and upload it to your server.)
Code:
Options -Indexes
__________________
Good Luck on your fix

My real hobby..JoyCo
My real Job..(Second Hobby) IAFF Local 1865
Like the sites? My hobby is the one that created them!
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,250 posts.
 
Join Date: Oct 2006
14-May-2007, 02:19 AM #3
Put an empty index file in each dir.

i.e. index.html
namenotfound's Avatar
Computer Specs
Distinguished Member with 2,197 posts.
 
Join Date: Apr 2005
Location: New York
Experience: I know what I know, I am
14-May-2007, 05:36 AM #4
Quote:
Originally Posted by MMJ
Put an empty index file in each dir.

i.e. index.html
Waste of time and resources. The .htaccesss approach is the best way to go with this.
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,250 posts.
 
Join Date: Oct 2006
14-May-2007, 07:36 AM #5
Quote:
Originally Posted by namenotfound
Waste of time and resources. The .htaccesss approach is the best way to go with this.
Resources? I would prefer the empty index file. Easy, quick, and more customizable. Also if you want to have indexes for a certain dir than you can more easily control that.
namenotfound's Avatar
Computer Specs
Distinguished Member with 2,197 posts.
 
Join Date: Apr 2005
Location: New York
Experience: I know what I know, I am
14-May-2007, 07:56 AM #6
Quote:
Originally Posted by MMJ
Resources? I would prefer the empty index file. Easy, quick, and more customizable. Also if you want to have indexes for a certain dir than you can more easily control that.
Yes resources. Let's say you have 100 of those blank index.html files, as 1KB a piece. That's 100KB worth is wasted disk space.

And if you want a certain directory to have an index list, just add an extra .htaccess file in that one directory to allow it. It's much easier, faster, and less resource consuming, than having to place an index.html file in EVERY directory you don't want access to.

Doing it the way you suggested is NOT more customizable, it's being too lazy to do it the right way.
__________________
-----------------------------
| 404: Name Not Found |
-----------------------------
PLEASE NOTE: If I happen to help you in a post, or just simply reply to it, doesn't mean I want to be bombarded with PMs. I answer all questions in posts, not in PMs. Thank you, and have a good day.

<?php $h = 'Hello '; $w = 'World'; echo $h.$w; ?>

My Favorite Editors:
Windows: Crimson Editor
Mac: Taco HTML Edit
Linux: gPHPEdit
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,250 posts.
 
Join Date: Oct 2006
14-May-2007, 09:51 AM #7
WHAT???

If they are empty why would they be 1kb???

Also I am assuming the OP only has one or two dirs.

Also unless I am very much mistaken vB puts empty index files in all it's dirs. While you could argue that this is so that it works on windows servers (which don't have .htaccess) this proves my point, more customizable and compatible.

It is NOT less resource consuming; .htaccess gives commands to apache, while index.html just sits as an empty file (0 bytes ).

And of course it is more customizable, disagreeing with that makes no sense.
__________________
Guys, please, this is free tech support, act accordingly.
Eriksrocks's Avatar
Computer Specs
Senior Member with 1,859 posts.
 
Join Date: Aug 2005
Location: Minnesota
Experience: Advanced
14-May-2007, 08:13 PM #8
I would go with the .htaccess...
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,250 posts.
 
Join Date: Oct 2006
15-May-2007, 04:17 AM #9
Quote:
Originally Posted by Eriksrocks
I would go with the .htaccess...
Each to his own.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:00 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.