How to disable folder directory listing

Hello ,i am creating my forum website by using MyBB Forum.
Everything is almost ready but now i have to secure the site.
This is my security test . picture: https://prnt.sc/w81hxa
Some folders are with enabled directory listing ,how to disable the directory listing?

Once you add a webpage or a file to those directories, the directory list will go away.

However, someone could still view that directory list. To stop that, do the following:

On your computer create a file named htaccess.txt

Use any text editor (notepad, etc.) to open it and add:

Options -Indexes

Save and upload this file to each of those directories. Then with the DH File Manager or any FTP program, rename those to: .htaccess
(note the preceding dot)

Before doing this however, check and see if those directories already have an .htaccess file. If so, instead of uploading a new .htaccess file (which will overwrite the existing one) just add that line below the code that’s already in there. You’d do this by downloading that existing .htaccess file, editing it as described, then uploading it back & overwriting the old one.

It sounds more complicated than it really is.

Note: As always, before changing anything, always make a copy of the old file on your computer.

2 Likes

Thanks very much for your answer and help.
Very simple explanation and understandable.
It worked.
Thanks again

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.