- 1 year ago
Apache stop webdav directory listing on windows
To stop Apache from showing directory listings for WebDAV directories on Windows, you can disable the Indexes
option in the Apache configuration for the specific WebDAV directory. Here's how you can do it:
Open the Apache configuration file (usually named
httpd.conf
) in a text editor. The configuration file is typically located in theconf
directory of your Apache installation.Locate the section of the configuration that sets up WebDAV. This section might look something like this:
apacheAlias /webdav "C:/path/to/webdav/directory"
<Directory "C:/path/to/webdav/directory">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
In the
<Directory>
block that corresponds to your WebDAV directory, remove or comment out theIndexes
option by adding a#
before it:apache<Directory "C:/path/to/webdav/directory">
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Save the configuration file and restart Apache for the changes to take effect.
After making this change, Apache will no longer display directory listings for the WebDAV directory, and users will only be able to access files within the directory if they know the correct URLs. If you have multiple WebDAV directories and want to apply the change to all of them, make sure to modify the <Directory>
blocks for each WebDAV directory in the configuration file.
Note: Before making changes to your Apache configuration, it's a good idea to create a backup of the original configuration file, so you can easily revert back if needed. Additionally, always be cautious when modifying the Apache configuration, as incorrect changes can cause issues with your web server.