I want to restrict access to a certain folder on my server (file uploads) using .htaccess. I have a windows server configured with XAMPP. In the upload folder, I added .htaccess, .htpasswd and htpasswd.exe (local server).
My .htaccess file looks like this:
AuthUserFile /.htpasswd
AuthName “Restricted Access Area”
AuthType Basic
require valid-user
And the htpasswd has one user and is in the same directory. Indexing is enabled. When I browse to the location of the folder, its not there, hidden. If I type in the exact address in the address bar, the username and password prompt come up. I type in the username and password that I added to the .htpasswd fike and it gives me a 500 server error. It doesn’t say anything in the access and error log.