Allow and/or deny directory listing with .htaccess




This article explains how to enable and disable directory listing on an Apache web server using .htaccess

1) .htaccess to disable directory listing on the server

Options -Indexes

2) .htaccess to allow directory listing on the server

Options +Indexes

3) .htaccess for echoose the type of directory listing

IndexOptions +FancyIndexing # To disable it use this instruction IndexOptions -FancyIndexing

4) .htaccess to ignore certain file extensions in the server list

The following example ignores the listing of PHP and ASP files

IndexIgnore *.php *.asp

Commentary

Comments

index.pe: Specialist in Front-End, Back-End, SEO, Social Media and UX.
Related Post
Leave a Comment

This page uses cookies.