.htaccess保护没有用户名的文件夹 [英] .htaccess protect folder without username

查看:108
本文介绍了.htaccess保护没有用户名的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过仅询问密码来保护具有.htaccess的文件夹?

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

我不需要用户名。

推荐答案

HTTP身份验证始终会询问用户名和密码,而不仅仅是密码。服务器不会生成弹出的表单,而浏览器会生成。该表格将始终具有用户名和密码。您不能告诉它仅要求输入密码。

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.

但是您可以做的是生成一个带有空白用户名的htpasswd文件,因此当登录窗口打开时,人们只需输入密码即可将用户名字段留空。

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.

这篇关于.htaccess保护没有用户名的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆