Denying Directory Listing With htaccess

24 04 2008

Just type:

Options -Indexes

That’s it!


Actions

Informations

8 responses to “Denying Directory Listing With htaccess”

14 06 2008
Root (11:04:01) :

I wish I had the same way of expressing myself in code the way you do. LOL. :)

15 06 2008
Root (11:33:36) :

Where did my comment go ? Am i err delisted? What’s up? It is as bad as the WP forum ?:) LOL.

PS: You need to be a Japanese caligraphist to understand your captcha graphics. :)

15 06 2008
Juan Wong (13:13:04) :

No, you weren’t marked as spam, I just didn’t turn my computer on yesterday but until today and found your comments in the queue. Sorry for posting them late.

:D

17 07 2008
WebTenet Solutions (03:47:53) :

I have two questions:

1. On a shared hosting if the host does not give you Override all, should this “Options -Indexes” work on my .htaccess file?

2. What should I do if I want to deny directory listng on an entire website but allow just one directory?

Thanks in advance :)

17 07 2008
Juan Wong (11:25:52) :

WebTenet,

1) I think you’re talking about the AllowOverride directive, correct? If the hosting provider has set it to None, then your .htaccess file will completely be ignored.

2) In the directory, where you want to allow directory listing, you should place an .htaccess file with the following: Options +Indexes

HTH

8 08 2008
vovaNux (22:53:53) :

Sometimes the following string will also work:

IndexIgnore *

12 11 2008
Digatex (04:51:40) :

Hi, do you mean that people can not see in the root directory?

12 11 2008
Juan Wong (17:04:44) :

Digatex,

If I understood your question well, then the answer is that the root (or any other) directory listing shouldn’t be allowed. Obviously, if the root (or any other) directory lacks of an “index” file, the person trying to access such directory would see a 403 message:

Forbidden

You don’t have permission to access /[directory_name]/ on this server.

HTH




LiveSTRONG