这是我的.htaccess:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
AuthUserFile /etc/hi
AuthName "hi"
AuthType Basic
require valid-user
Run Code Online (Sandbox Code Playgroud)
它要求使用http进行用户身份验证,这意味着密码将以纯文本形式发送.它将重定向到https版本并再次询问密码.
我该如何解决?
是否可以使用密码保护虚拟目录(例如wordpress类别):
/c/sofas/
Run Code Online (Sandbox Code Playgroud)
它看起来像<Location /c/sofas/>在httpd_config中工作,但不是.htaccess
可能吗?可能在某处有mod_rewrite?
apache .htaccess basic-authentication virtual-directory .htpasswd