How can I turn off directory indexing?


#1

I would like to have my wp-content/uploads directory not be publicly accessible…but I don’t know how to do that. Can someone help me?

Thank you


#2

.htaccess can do this for you :slight_smile:

Put this at the very top:

Options -Indexes

#3

I know this is very basic…but I don’t know where to find the .htaccess file. Is that something I would see in my ftp, or in the dreamhost control panel?

Thank you for your help


#4

create a file with that one line in it, and upload it to your uploads folder with the name .htaccess


#5

thank you very much!


#6

WordPress makes a .htaccess for you if you have pretty permalinks so you can add it to the top of that one.


#7

Shouldn’t wp-content/uploads have a blank (or other) index file in it by default?


#8

Nope. Probably in part because WP leaves your wp-content folder alone when upgrading :slight_smile: