如何在 XAMPP 子目录的开头通过 .htaccess 设置视图保护?
How to set view protection in the beginning by .htaccess in the XAMPP for sub directories?
我在xampp上有本地网站(php),我想设置用户密码登录保护,如图
我在 .htaccess 中设置:
Options -Indexes
allow from 127.0.0.0
AuthName "Password Protected Area"
AuthUserFile /htaccess/.htpasswd
AuthType Basic
Require valid-user
我在 .htpasswd 中设置:
user:y$L7cqU20P.fbfHwIL7cqU20PsvrhnN.Pb1rAxR50y
但是我在输入用户密码后得到这个错误:
我用 this 但没用。
当我输入 http:127.0.0.1/hi
时有效,但当我输入子目录时无效 (http:127.0.0.1/hi/test1
) 并给出 500 错误。
我的代码没有问题,但我不知道为什么当我删除所有子文件夹时都创建了一个 .htaccess 空文件。
我在xampp上有本地网站(php),我想设置用户密码登录保护,如图
我在 .htaccess 中设置:
Options -Indexes
allow from 127.0.0.0
AuthName "Password Protected Area"
AuthUserFile /htaccess/.htpasswd
AuthType Basic
Require valid-user
我在 .htpasswd 中设置:
user:y$L7cqU20P.fbfHwIL7cqU20PsvrhnN.Pb1rAxR50y
但是我在输入用户密码后得到这个错误:
我用 this 但没用。
当我输入 http:127.0.0.1/hi
时有效,但当我输入子目录时无效 (http:127.0.0.1/hi/test1
) 并给出 500 错误。
我的代码没有问题,但我不知道为什么当我删除所有子文件夹时都创建了一个 .htaccess 空文件。