troubleshooting Question

Block directory listing when browsing by IP

Avatar of Daniele Brunengo
Daniele BrunengoFlag for Italy asked on
HTML* CentOSApache Web Server
11 Comments1 Solution255 ViewsLast Modified:
Hello. I'd like my Centos web server to NOT allow directory listing when you're browsing folders like this:

I have tried with .htaccess in the main html folder but it doesn't work.

My apache is configured like this: each domain has a configuration file in /etc/httpd/sites-available (and a link in sites-enabled).

So I guess I should add a configuration file for when you're browsing the server by IP. I have no idea how, though.

It works if I set
Options -Indexes
in httpd.conf, but this would block all indexing. I was wondering if this can be an issue when set globally.

Can someone help me? Thanks.
David Favor
Fractional CTO
Join our community to see this answer!
Unlock 1 Answer and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros