Ho to hidden the folder on ubuntu server?

Posted April 18, 2014 2.1k views
Suppose My site Url sitename////index.php When i enter the url like this sitename/// User can see what are folder is available under this url . I don't want to show the folder how to block this.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer
For Apache:
Add the following line to your .htaccess file.

Options -Indexes

Make sure you hit the ENTER key (or RETURN key if you use a Mac) after entering the "Options -Indexes" words so that the file ends with a blank line.

For Nginx:
Try something like this in config file:

location /{
root /home/yozloy/html/;
index index.html;
autoindex on;

"autoindex" is the key, u can google it.

The answers are all googled.