How to enable directory and file listing in XAMPP ? In WAMP it is by default enabled.
Re: Disable directory listing You just need to look for the file httpd. conf and edit this file. Search for Indexes in this file and set it to -Indexes. Restart Apache and then directory listing is switched off for all your folders.
My Xampp httpd.conf already had the Indexes option under the xampp directory entry Removing all the default #comment lines, it looks like this:
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
But, I have my local root mapped to a different directory, outside of 'htdocs', (as per this post Make XAMPP/Apache serve file outside of htdocs ) so to enable this for all directories, I had to find the entry just above that, and add the word "Indexes" to it.
<Directory />
Options FollowSymLinks Indexes
AllowOverride None
Order deny,allow
Deny from all
</Directory>
Note I would never enable this for all directories on a production server, but locally it is quite useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With