Go Back   Web Server Hosting Forum by BODHost > Support > Tutorials and Documentation
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 10-10-08, 18:14
BOD Member
 
Join Date: Oct 2008
Posts: 30
Default How to disable the Directory listing for folders?

To disable the Directory listing for folders you need to create the .htaccess file under the each an every folder under which you want to disable the Directory listing and insert the following code in .htaccess file.


Quote:
Options -Indexes

It will disable the directory listing for your folders and redirect to your 403 error page
__________________
Regards
George
Reply With Quote
  #2 (permalink)  
Old 02-06-09, 22:15
BOD Member
 
Join Date: Jan 2009
Posts: 102
Default

This is an excellent tip. Thank you for making this available. I've been trying to find something online to help me with this issue for a while now when I should have been looking here all along.
Reply With Quote
  #3 (permalink)  
Old 02-06-09, 23:08
BOD Member
 
Join Date: Jan 2009
Posts: 98
Default

That's useful to implement on sites that have a folder dedicated only for images.

Alternatively, you can always just stick in a blank index.html though, as that should prevent directory listing as well if I'm not mistaken.
Reply With Quote
  #4 (permalink)  
Old 02-07-09, 00:03
BOD Member
 
Join Date: Jan 2009
Posts: 49
Default

I thought that a blank index file just hid the contents from view on the web? Does the tip provided hide the folders themselves from showing up in peoples Internet browsers?
Reply With Quote
  #5 (permalink)  
Old 02-07-09, 12:41
BOD Member
 
Join Date: Nov 2005
Location: New Mexico
Posts: 273
Default

if you want to hide the directory contents, and not to redirect the user to a live page you could show a blank directory page by simply hiding the contents of the directory using the part of the tutorial located at:

Comprehensive guide to .htaccess- Preventing Directory Listing
Reply With Quote
  #6 (permalink)  
Old 02-07-09, 18:35
carl owen's Avatar
Super Moderator
 
Join Date: Nov 2008
Posts: 1,059
Smile

Thank you George and Christina. Both the posts very extremely useful. Hope to see some more posts like these from both of you.
Reply With Quote
  #7 (permalink)  
Old 02-08-09, 08:44
BOD Member
 
Join Date: Jan 2009
Posts: 73
Default

Thanks - you made me remember about something I was going to do to my sites about a year ago, and totally forgot about - it was the thing that has been niggling at the back of my mind every time I was logged into my site. Just off to make a .htaccess in every folder (I have them in a few places to stop google indexing where its not meant to but I should go and double check)
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 03:06.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.