Deny Directory Listing in .htaccess

Some webmasters upload a blank index.html for dont index directories. Thats a way of listing directories. But htaccess is more easier solution for this. Just add this code to your .htaccess file

Options -Indexes

Allow directory index, remove the that code or change

Options +Indexes

If you want to list files in directory, but except some of filetypes. Example this code is ignoring zip and rar files.

IndexIgnore *.zip *.rar

 You can disable directory indexing with indexignore too

IndexIgnore *

 Another way is changing the directory index file

DirectoryIndex this_my_index_file.html

Oyun