Click to See Complete Forum and Search --> : IndexIgnore... the right syntax ?


Ness_du_Frat
04-06-2005, 04:43 AM
Hello everybody !!!
I have a folder, which I want to prevent the browser from indexing. I found that with an .htaccess file containing this line :
IndexIgnore *
it would prevent the folder from being indexed.

The problem is, I now get and "internal server error 500", so, a syntax error in the .htaccess file...
Any help would be great...
Ness

buntine
04-06-2005, 06:49 AM
If I remember correctly, isn't it like this:

Options -indexes

or this:

IndexIgnore */*

?

Regards.

Ness_du_Frat
04-06-2005, 07:42 AM
I tried both. Neither works... :( Do you put anything else in the file ?

buntine
04-06-2005, 08:29 AM
I don' think so. Where have you got your .htaccess file?

buntine
04-06-2005, 08:31 AM
Also, you must be using Apache. Your not on a Windows server are you?

Ness_du_Frat
04-06-2005, 08:53 AM
No no, I'm on Apache, of course !! lol !!!
My provider disabled some Apache functions, but they didn't say anything about this one.
My .htaccess file is in the folder I don't want listed. Actually, my point is to protect a folder, but the .htaccess protection gives an ugly popup box, and no way I can get rid of it. So I chose a javascript way, but anyone can access to the directory and view the files, so...
I know I'm making it complicated... I can also put an index.htm file in the folder, and it would be done. But, it's just that I saw this way, and I wanted to learn how to use it. Could be useful to prevent people from putting their nose where they shouldn't...

Ness_du_Frat
04-06-2005, 02:12 PM
It's solved !!!! Thanks ! It was IndexIgnore */* It needed to be uploaded in SCII, which I did, but on a Mac, and... you know, macs... I did it with the pc, everything is fine !!! Thanks !!!!

buntine
04-06-2005, 10:07 PM
lol Cheers. ;)

xjessie007
11-21-2008, 09:44 AM
Hi,

Glad you found the solution. Just for the sake of clarity for everyone who has a problem with this..

IndexIgnore * was correct too, I have it this way, and it works for me too. The problem must have been somewhere else. IndexIgnore * and Options -indexes relate to the same thing, but they both need to be in sync and set up correctly.

Here is a summary how it works:

A)
If you have access to your httpd.conf (server configuration) file, the IndexIgnore directive adds to the list of files to hide when listing a directory.

IndexIgnore *

This setting is global. If you want to disable listing for just some folders, then:

B)
If you can edit your .htaccess file (the one in the folder you want prevent from dir listing), insert the following:

Options -Indexes

This stops showing directory listings for URLs which map to the directory.

C)
You could also disable dir indexing completely. Find the following line in your httpd.conf and place a # in front of it.

LoadModule autoindex_module modules/mod_autoindex.so

This will disable directory listing completely for everyone and everywhere.

D)
The Allow,Deny relates to restricting access . Again, this can be either in your httpd.conf or in your .htaccess.

Here is a good page on IndexIgnore: IndexIgnore (http://www.maxi-pedia.com/IndexIgnore)

See here if interested learning about Order Allow,Deny: Order Allow,Deny (http://www.maxi-pedia.com/Order+allow+deny)

Cheers. What is your website? Just currious.