Doug Smith
Doug Smith

Reputation: 29326

How do you hide the folders in your websites public_html folder?

I don't like how if you go to certain folders on my website that don't contain a .html file that it will list all the files in it. I don't want to give access to that. Such as: http://christianselig.com/css

How do I hide these?

Upvotes: 4

Views: 8805

Answers (2)

ditscheri
ditscheri

Reputation: 579

You need to tell your webserver to stop directory listings. For apache, add this to your httpd.conf or any other related config file

<Directory /path/to/directory>
   Options -Indexes
</Directory>

If placed in a .htaccess file, AllowOverride Options must be enabled for the desired directory.

Upvotes: 4

Dmitry Stukalov
Dmitry Stukalov

Reputation: 192

If you are using Apache webserver and have access to httpd.conf you can set "Options -Indexes" for directory which content you want to hide. If you have no access to httpd.conf you can create .htaccess file in directory which content you want to hide with "IndexIgnore *"

Upvotes: 3

Related Questions