logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Can't disable directory browsing.
Author
velkkor



Joined: 21 Jul 2020
Posts: 2
Location: USA

PostPosted: Tue 21 Jul '20 15:13    Post subject: Can't disable directory browsing. Reply with quote

I've installed Apache on a Windows 2019 test server and have everything working, however I'm unable to disable the directory browsing.

In my httpd.conf, I've tried the following:

Code:

<Directory />
    Options -Indexes
</Directory>


Code:

<Directory />
    Options None
</Directory>


Neither of the above have worked, and removing/renaming the index.html in the root web folder results in Apache displaying the contents of that directory.

Interestingly enough, if I allow overrides and put a .htaccess file in the root directory with a Options -Indexes statement it *also* still displays the directory content, but will put an entry in the error.log saying that access was denied due to the .htaccess file in that folder (even though it wasn't).

Is there another step I'm missing in turning this off in a Windows environment?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Tue 21 Jul '20 16:29    Post subject: Reply with quote

You need to set that in Directory for your web root, too.
Back to top
velkkor



Joined: 21 Jul 2020
Posts: 2
Location: USA

PostPosted: Tue 21 Jul '20 16:47    Post subject: Reply with quote

I think that's the only place I have it. I thought that's what <Directory /> was (the root).

Currently all I have is a few files in the webroot.

**EDIT**

Aha, I've got it. I was *only* doing it in the webroot. I see further down is the option for the actual htdocs folder (which I erroneously thought was the same as /).

I removed the Indexes reference from there and all is well. Thanks!
Back to top


Reply to topic   Topic: Can't disable directory browsing. View previous topic :: View next topic
Post new topic   Forum Index -> Apache