.htaccess file is not working on Apache 2.4.12 and Windows Server 2008 R2

.htaccessapache-2.4authenticationhttp-basic-authentication

I am trying to add Authentication window to a section of the site using .htaccess file.

But It is not working "the site is acting that the ".htaccess" files does not exists.

here is that content of my .htaccess file

AuthType Basic
AuthName "PHP MyAdmin"
AuthUserFile "c:/.htpasswd"
Require valid-user

the .htpasswd file is located on the C: drive.

and the .htaccess file is located inside a folder called dba so I want to secure the dba folder.

I have opned the httpd.conf file and updated the AllowOverride option from none to Indexed like this

<Directory />
     AllowOverride Indexed
     Require all denied
</Directory>

before this change this is how it was

AllowOverride None
Require all denied

How can i get the site to require a user authentication when someone tried to access the dba directory?

I have Apache 2.4.12 installed on Windows Server 2008 R2

Best Answer

Have you checked the file system permissions? I would like to think that the default user account running apache should not have access to c:/....

http://httpd.apache.org/docs/2.4/howto/htaccess.html

Related Topic