Rais Jean Mehdi
Rais Jean Mehdi

Reputation: 161

.htaccess protect folder without username

Is it possible to protect a folder with .htaccess by asking just a password?

I don't want a username.

Upvotes: 15

Views: 12096

Answers (1)

Jon Lin
Jon Lin

Reputation: 143906

HTTP auth will always ask for a username and password, and not just a password. The server doesn't generate the form that pops up, your browser does. And that form will always have a username and password. You can't tell it to only ask for a password.

But what you can do is generate an htpasswd file with a blank username so when the login window opens, people only need to enter a password and can leave the username field blank.

Upvotes: 16

Related Questions