1

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

1 Answer 1

0

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

1
  • I just moved the file into the main path for php and it did not work also, AuthType Basic AuthName "PHP MyAdmin" AuthUserFile "c:/phpsites/.htpasswd" Require valid-user
    – Mike
    Apr 14, 2015 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.