I created an .htaccess file with only the following line:
Options -Indexes
However, the index is still shown for the directory.
I just installed Apache2 and am using all the defaults (I did not modify apache2.conf or httpd.conf).
OS: Ubuntu 12.04 (Precise Pangolin)
Apache2 version: Server version: Apache/2.2.22 (Ubuntu) Server built: Feb 13 2012 01:51:56
$ ls -l .htaccess
-rwxr-xr-x .htaccess
EDIT:
I took lanzz's advice and added gibberish to the .htaccess
file, and discovered that the .htaccess
file is not being read.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…