Htaccess?


#1

Hi everyone, ive got a problem, maybe someone knows how to solve it. Basically, i have a directory on my webserver, lets say its http://www.domain.com/content and lots of subdirectories, randomly created by a script. f.ex. http://www.domain.com/content/1b
http://www.domain.com/content/5c
http://www.domain.com/content/9y
etc.

these directories are created automatically when some content, for example a picture or a video clip, is uploaded.

Now, what i would like to do is to prevent people from seeing the list of pictures or videos in these subdirectories when directly going to a url like http://www.domain.com/content/5c. I placed a blank index.html file in the main “content” directory and it prevents people from seeing the list of subdirectories, but i cant figure out how to prevent people from seeing the contents of those subdirectories as they are created automatically and placing each time a blank page into each of them would be really time consuming. maybe theres a better way to do this, probably by configuring the .htaccess file somehow…can someone help? tnx.


#2

Place the following line in the .htaccess file in your domains web-directory;

[color=#0000CC]Options -Indexes[/color]

This will affect the directory it is placed in and all directories further down the directory structure.

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#3

as mark said, you can do it by setting up htaccess file. you can refer to wiki
http://wiki.dreamhost.com/index.php/Modifying_directory_indexes and http://wiki.dreamhost.com/index.php/Htaccess on how to use htaccess. It is very helpful.

Save [color=#CC0000]$97[/color] (max discount) on dreamhost plans by using promo code: [color=#CC0000]97CRAZY[/color].


#4

tnx a lot guys, works perfectly.