Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
Why use index files in every directory?
Old 03-14-2008, 02:49 AM Why use index files in every directory?
EditFast's Avatar
Experienced Talker

Posts: 43
Trades: 0
I use a program (Guardian) to send me notifications when an error occurs on my site (404, 403 etc.) These notices contain the URL causing the error and the referring URL. Lately I have been getting numerous notifications with URLs to directories without index files (On a side note, these URLs also contain within them, urls to other sites. I assume this is some spammer technique and I am not too concerned about this in this post but if someone can shed some light on how/why they (the spammers) do this I would appreciate it.)

My purpose in posting here is to find out about the use of index files in directories. I have read that this is a good idea, but I have yet to hear why except that in case someone navigates to the URL of the directory rather than the actual page URL, then they will not get a 403 error message, but this seems like a rather weak reason to me. Is there another reason? SEO reason? Technical reason?

If I find good reason to do this, is it enough to just put a blank index file in each directory? If so why? What purpose does it serve (aside from thwarting the spammers doing what I described above.) Thanks in advance for your help.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
EditFast is offline
Reply With Quote
View Public Profile Visit EditFast's homepage!
 
 
Register now for full access!
Old 03-14-2008, 04:25 AM Re: Why use index files in every directory?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,528
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It's not so much spammers that it stops, but it can prevent "crackers" from "seeing" what files are in the folder. So if the "hunting" bot can't "see" them it won't report a potential target for an attack.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-14-2008, 06:15 AM Re: Why use index files in every directory?
EditFast's Avatar
Experienced Talker

Posts: 43
Trades: 0
Quote:
Originally Posted by chrishirst View Post
It's not so much spammers that it stops, but it can prevent "crackers" from "seeing" what files are in the folder. So if the "hunting" bot can't "see" them it won't report a potential target for an attack.
They can't see what's there if the server is set to respond with a 403 error page, which is what I have done as I indicated above.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
EditFast is offline
Reply With Quote
View Public Profile Visit EditFast's homepage!
 
Old 03-14-2008, 07:23 AM Re: Why use index files in every directory?
Skilled Talker

Posts: 59
Name: Dan
Trades: 0
From a security standpoint best practice states that you should include an index for the reason chris outlines above. It's a belt and braces approach really, if something happens on your webserver and it suddenly allows directory listings as a result of mis-configuration then index files will add an extra layer to prevent directory listings.
__________________

Please login or register to view this content. Registration is FREE

Nuts to that I just want to
Please login or register to view this content. Registration is FREE
Monkey Do is offline
Reply With Quote
View Public Profile
 
Old 03-14-2008, 08:20 AM Re: Why use index files in every directory?
EditFast's Avatar
Experienced Talker

Posts: 43
Trades: 0
Quote:
Originally Posted by Monkey Do View Post
From a security standpoint best practice states that you should include an index for the reason chris outlines above. It's a belt and braces approach really, if something happens on your webserver and it suddenly allows directory listings as a result of mis-configuration then index files will add an extra layer to prevent directory listings.
That's a clear and good reason. Now I am convinced. So, just a blank index.htm file is all I need?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
EditFast is offline
Reply With Quote
View Public Profile Visit EditFast's homepage!
 
Old 03-15-2008, 08:11 PM Re: Why use index files in every directory?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,528
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Yep. ..
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-15-2008, 10:37 PM Re: Why use index files in every directory?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Or, if apache, you could deactivate the directory listing at all.
It would prevent it without needing to put a blank file everywhere.
http://httpd.apache.org/docs/2.0/mod/core.html#options

Simply add a section like this:
Code:
<directory />
  options -indexes
</directory>
in a .htaccess in the root directory would disable server generation of a list of files in any directory. A 401 - forbidden will be returned.

Warning: the default value of options, if not specified, is "all", so by adding just -indexes, you deactivate all the other.
You must add them (with a +name_of_option) to enabled them back.
I would usually use this:
Code:
options -indexes +ExecCGI +FollowSymLinks +Includes
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 03-16-2008, 11:40 AM Re: Why use index files in every directory?
QiSoftware's Avatar
Skilled Talker

Posts: 74
Location: U.S.
Trades: 0
The reason to have an index.html file is to prevent directory contents from being provided to surfers when they request the html file specifically. The problem is that in most cases, putting a blank index.html file in the directory overrides the index.php call. This is not good if it is a WordPress or forum directory.

To override this use something like this in the directorys .htaccess file:

DirectoryIndex index.php index.html index.htm index.cgi
Options -Indexes

This makes the index.php file the default and insures no one can see the contents of your directory. Setting indexes off-- does not always fix the problem.

Q...
__________________


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
QiSoftware is offline
Reply With Quote
View Public Profile Visit QiSoftware's homepage!
 
Reply     « Reply to Why use index files in every directory?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29041 seconds with 12 queries