There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: Preventing a directory listing


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!

 
Thread Tools
smooth's Avatar
Distinguished Member with 3,476 posts.
 
Join Date: Sep 2005
Location: NC, USA
Experience: Learning everyday :)
16-Nov-2005, 01:38 PM #1
Solved: Preventing a directory listing
Hello again,

How do you stop your site from having a directory listing in a folder?

For example, my images folder, how can I protect it from someone typing in:

http://www.mysite.com/images

And then them shown a directory of my images folder? I am pretty sure there is a way of doing this.

Any ideas?
__________________

Meet Your Fellow TSG Members :: Find Out What CWLMST Means :: NCAA Football :: NCAA Basketball


Looking forward to meeting you up in heaven angel

I don't care how bad I feel, when I go to work I make sure I give it my all! Never any less than 12%...

47.5% of all statistics are made up right on the spot

When something is done in ignorance, then its always best to admit that you have no excuse, fix the problem, put it behind you, and move on - valley
Sequal7's Avatar
Computer Specs
Distinguished Member with 2,369 posts.
 
Join Date: Apr 2001
Location: Around the corner!
Experience: Including today?
16-Nov-2005, 03:18 PM #2
Depends on your host type how to protect directories.
Who and what is your host and if you have a hosting provider, what type of Control panel do they use?
smooth's Avatar
Distinguished Member with 3,476 posts.
 
Join Date: Sep 2005
Location: NC, USA
Experience: Learning everyday :)
16-Nov-2005, 03:22 PM #3
Our host is 1and1, and you can see the admin login page here.

I'm not sure exactly what type of panel it is, maybe CPanel?

We are under the Microsoft Developer package.
Squashman's Avatar
Distinguished Member with 12,519 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
16-Nov-2005, 04:48 PM #4
Just put an index.html file in the directory and have it redirect to the main web page. If you were running on an apache server you could also use an .htaccess file but we already know you are using IIS.
smooth's Avatar
Distinguished Member with 3,476 posts.
 
Join Date: Sep 2005
Location: NC, USA
Experience: Learning everyday :)
16-Nov-2005, 04:52 PM #5
Yeah, I was afraid I would have to do that.

I'm thinking I'll have to put that redirect index page in all my folders on the site, because if I type in any of my directories, I get a file list.

Grrr....so using .htaccess is about the only way of doing this, besides the redirect page?
__________________

Meet Your Fellow TSG Members :: Find Out What CWLMST Means :: NCAA Football :: NCAA Basketball


Looking forward to meeting you up in heaven angel

I don't care how bad I feel, when I go to work I make sure I give it my all! Never any less than 12%...

47.5% of all statistics are made up right on the spot

When something is done in ignorance, then its always best to admit that you have no excuse, fix the problem, put it behind you, and move on - valley
Squashman's Avatar
Distinguished Member with 12,519 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
16-Nov-2005, 05:07 PM #6
Just read up a little bit more on IIS. I don't think Directory Browsing is enabled by default on IIS. They must have turned it on for some reason. I would talk with your webhost and ask them why they have directory browsing enabled. If I were you I would ***** and complain. Most of the Linux apache Web hosting providers I have used always have that turned off and it is easily turned back on by using an htaccess file for the directories you want directory listings for. It will be a real pain in the butt to put an Index file in every directory if you have a very large directory structure.

If I am reading the documentation for IIS correclty, your webhost should be able to turn off Indexing for your website without affecting any other hosts on the server. It should be able to do it on a per website basis.
__________________
I hate asking the same question twice!
How to ask questions the smart way!
Microsoft MVP - Windows Shell/User
Sequal7's Avatar
Computer Specs
Distinguished Member with 2,369 posts.
 
Join Date: Apr 2001
Location: Around the corner!
Experience: Including today?
16-Nov-2005, 05:46 PM #7
Is the problem that you trying to access a page, example index.asp and it is displaying the directory of the sites root?

Or are you trying to simply protect your folders from viewing?

1&1 panel for Windows hosting is easy, they dont use CPanel they have thier own interface.

open webfiles
http://faq.1and1.com/applications/webfiles/2.html
select and set right management on your folder
http://faq.1and1.com/applications/webfiles/3.html

If those dont work, perhaps try the IIS snapin:
Follow direction here to protect your directory
http://faq.1and1.com/web_space__acce...ctories/4.html
__________________
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!
Squashman's Avatar
Distinguished Member with 12,519 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
16-Nov-2005, 06:25 PM #8
Wow, that looks like it solves your password protection problem as well.
smooth's Avatar
Distinguished Member with 3,476 posts.
 
Join Date: Sep 2005
Location: NC, USA
Experience: Learning everyday :)
16-Nov-2005, 10:11 PM #9
Thanks, I'll call them and make sure to tell them I want them to turn off directory browsing.

No, we already have the protected directory set up, that's why I need to use the ASP thing. Having the protected directory only allows one username, and one password, which everyone would use to log in. We want every one to have there own user name, and own password, so we can delete them if they leave the company, so they can't log in to the company after they leave.
__________________

Meet Your Fellow TSG Members :: Find Out What CWLMST Means :: NCAA Football :: NCAA Basketball


Looking forward to meeting you up in heaven angel

I don't care how bad I feel, when I go to work I make sure I give it my all! Never any less than 12%...

47.5% of all statistics are made up right on the spot

When something is done in ignorance, then its always best to admit that you have no excuse, fix the problem, put it behind you, and move on - valley
Squashman's Avatar
Distinguished Member with 12,519 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
16-Nov-2005, 10:57 PM #10
What is the new user button for then. Will it not let you create more than one user.
smooth's Avatar
Distinguished Member with 3,476 posts.
 
Join Date: Sep 2005
Location: NC, USA
Experience: Learning everyday :)
16-Nov-2005, 11:20 PM #11
Wow, didn't see that on there. I'll have to try that out. Not sure if I have that in my package, I'll check it out.
smooth's Avatar
Distinguished Member with 3,476 posts.
 
Join Date: Sep 2005
Location: NC, USA
Experience: Learning everyday :)
16-Nov-2005, 11:22 PM #12
Oh, the Add button is to add a directory, not a user
Sequal7's Avatar
Computer Specs
Distinguished Member with 2,369 posts.
 
Join Date: Apr 2001
Location: Around the corner!
Experience: Including today?
17-Nov-2005, 01:29 AM #13
Ok, I am reallly confused by your question now.
Quote:
How do you stop your site from having a directory listing in a folder?

For example, my images folder, how can I protect it from someone typing in:

http://www.mysite.com/images

And then them shown a directory of my images folder? I am pretty sure there is a way of doing this.
If you already have protected directories why are you asking how to protect a directory?
Squashman's Avatar
Distinguished Member with 12,519 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
17-Nov-2005, 01:50 AM #14
Quote:
Originally Posted by smooth246
Oh, the Add button is to add a directory, not a user
Not talking about the add directory button. There is one above that says New User and there is a box to the right of that for the username.
Attached Thumbnails
solved-preventing-directory-listing-newuser.jpg  
Squashman's Avatar
Distinguished Member with 12,519 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
17-Nov-2005, 01:52 AM #15
Quote:
Originally Posted by Sequal7
Ok, I am reallly confused by your question now.
If you already have protected directories why are you asking how to protect a directory?
He is talking about keeping the server from doing Directory listings. If he doesn't have an index.html file in the directory, it will show all the files in the directory. This is usually turned off by default on most servers. On an apache server it is real easy to turn back on with an .htaccess file but he is on an IIS server.
__________________
I hate asking the same question twice!
How to ask questions the smart way!
Microsoft MVP - Windows Shell/User
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

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 08:35 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.