How to hide folders in public_html folder of websites?

I do not like how if you get to certain folders on my website that do not contain a .html file, it will list all the files in it. I do not want to provide access to this. For example: http://christianselig.com/css

How to hide them?

+4
source share
2 answers

If you use the Apache web server and have access to httpd.conf, you can set "-Indexes Options" for the directory whose contents you want to hide. If you do not have access to httpd.conf, you can create a .htaccess file in a directory whose contents you want to hide using "IndexIgnore *"

+3
source

You need to tell the web server to stop the directory listing. For apache add this to your httpd.conf or any other related configuration file

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

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

+4
source

Source: https://habr.com/ru/post/1436357/


All Articles