I use xampp and I put the htaccess in the root of site (Example).
So I have the file .htaccess in the same folder of .htpasswd. when I do http://localhost/Example I must put the access value and I put these values but after I obtain:

Error 500

Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30

This is my .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /example/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /festivalmusicasullacqua/index.php [L]

AuthUserFile /example/.htpasswd
AuthName "Authorization Form Title"
AuthType Basic

#Allow any valid user
require valid-user

#Allow only one user with specified username
require user festival

# END WordPress

This is my .htpasswd that is in the same foler of .htaccess


Read more here: I want use .htaccess to block access to all user but I let access only an user


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: