Okay, lets try a full working example.
I have xampp installed directly in C:\
The path of my .htuser Password-file (created with the htpasswd tool of apache) is c:\xampp\.htuser
i have a project folder c:\xampp\htdocs\projectxy\
the path of my .htaccess file is c:\xampp\htdocs\projectxy\.htaccess
The source of my .htaccess file is the following:
- Code: Select all
AuthType Basic
AuthName "Service LogIn"
AuthUserFile C:/xampp/.htuser
Require valid-user
Thats all.
You can create your own <Directory> Block for your project-folder in httpd.conf (like the Directory-Block for the htdocs folder). It's important that this Directory Block has an AllowOverride Rule whichs allows the override by htaccess-files (the htdocs <Directory> Block does have this rule by default.
You can create your own VHost for your project-folder too. But thats a different topic.