在.htaccess文件中增加 AuthUserFile /var/www/htpasswd/test.htpasswd AuthName EnterPassword AuthType Basic require valid-user #htpasswd密码文件生成.Create a password file Filename with username as the initial ID. It will prompt for the password htpasswd -c Filenam