Apache DirectoryIndex not working for subfolder

1.1k Views Asked by At

I'm using an .htaccess file to set a few options for a folder but the DirectoryIndex rule doesn't seem to be working in a sub-folder. Here is my .htaccess file.

AuthUserFile /var/www/.htpasswd
AuthType Basic
AuthName "Folder"
Require user joe
DirectoryIndex index.htm index.html

I know it is loading the .htaccess file because it is asking for the password if I try to go directly to the sub-folder but it won't load the index.htm file that is in there, I have to manually type in index.htm. The root folder with the .htaccess file does automatically load the index.htm file. What am I missing? Thanks!

1

There are 1 best solutions below

0
On

Turns out Passenger was causing the problem. The solution was to disable Passenger for that folder.

<Location /public>
    PassengerEnabled off
</Location>