Welcome to WebmasterWorld Guest from 23.20.82.60

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Protect File Folders

Keeping the public from viewing content of folders

     
9:41 pm on Mar 26, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 21, 2004
posts:53
votes: 0


How do I protect file folders like "stylesheets" "php scripts" etc, from exposing their directories to the public? If a visitors would come upon these folders, they would be able to see the content of the folder, and view the documents.

Thanks in Advance,
SenMar

10:04 pm on Mar 26, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 21, 2004
posts:418
votes: 0


Hi,

they wont be able to see php scripts, but they will be able to see style sheets.

But ive no experience if there is solution to stop both from being public.

10:17 pm on Mar 26, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 21, 2004
posts:53
votes: 0


You are absolutely correct about php scripts. I didn't mean to include it. I have a small comments board on my site, if you click on the directory/folder name, you'll see the entire content of the folder. How can I keep the directory hidden, without creating an index.php page? Is there another way to do this?

Thanks in advance,
SenMar

11:26 pm on Mar 26, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Feb 10, 2006
posts:627
votes: 0


One way of doing it is to add .htaccess file to your folder and include this in it:

Options All -Indexes

HTH

11:33 pm on Mar 26, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 21, 2004
posts:53
votes: 0


Thanks for your help!

SenMar

1:39 pm on Mar 27, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 15, 2004
posts:1867
votes: 0


It could get a bit nasty but I put index.php pages in all the folders redirecting them to different pages according to the folder they try to access. It works well.

Habtom