.htaccess .htpasswd 访问密码设置

来源:互联网 发布:研究生小论文数据造假 编辑:程序博客网 时间:2024/05/21 22:22
  1. .htaccess

    #绝对位置AuthUserFile D:/phpStudy/WWW/test_htaccess/.htpasswdAuthType BasicAuthName "restricted"Order Deny,AllowDeny from allRequire valid-userSatisfy any
  2. .htpasswd
    fly:apr18o5QSoJ.$I8fFOb12VkhL5V3mlZtgm.

  3. index.php

    <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>测试文件</title></head><body><div align="center">    恭喜你,你访问到本目录下的文件了!</div></body></html>

    测试地址:/test_htaccess/(用户名:ccp330;密码:1234567)

0 0