How to disable directory browsing?

How to disable directory browsing?

Posted by: LunchTimeUser
Posted on: 2009-02-10 22:48:00

Hi, I have a directory that I want to disable directory browsing. I tried to FTP .htaccess file containing the one line;

Option -Indexes

into the folder, but everytime I FTP it over, it seems to get erased when it copies over?

I mean, I tried copying the file over as test.htaccess and then renaming it once it gets copied over, but it gets deleted immediatly?

... is there an easier way to turn off directory browsing for a specific directory?


Thanks in advance!

Re: How to disable directory browsing?

Posted by: Atropos7
Posted on: 2009-02-10 23:02:00

In reply to:

I mean, I tried copying the file over as test.htaccess and then renaming it once it gets copied over, but it gets deleted immediatly?


It's not getting erased. Filenames that begin with a period are considered "hidden". You need to configure FTP client to "view hidden files"



cool openvein.org -//-

Re: How to disable directory browsing?

Posted by: tomt
Posted on: 2009-02-10 23:06:00

Not certain of your syntax.
My .htaccess entry for same is:

Options -Indexes

Regards.

Re: How to disable directory browsing?

Posted by: LunchTimeUser
Posted on: 2009-02-11 05:14:00

Thanks for your help. I enabled "view hidden files" on my FTP client(FireFTP plug-in for FireFox) and I see that the file does not exist. I tried again copying a test.htaccess and renaming it and this time, it worked!

Re: How to disable directory browsing?

Posted by: LunchTimeUser
Posted on: 2009-02-11 05:16:00

Thanks for your reply. Your suggestion combined with Atropos7 has got me to get the behavior that I wanted.

Tags: thanks in advanceindexes