aitaii
V2EX  ›  问与答

请教一个 apache 的 .htaccess 文件问题

  •  
  •   aitaii · Jan 12, 2015 · 2172 views
    This topic created in 4170 days ago, the information mentioned may be changed or developed.

    请教一个问题(百度出来自己做的不对):访问 /r 目录需要帐号密码权限
    生成2个文件.htpasswd 和..htaccess
    .htaccess内容为:
    <Files ~ "^\.(htaccess|htpasswd)$">
    deny from all
    </Files>
    AuthUserFile /r/.htpasswd
    AuthGroupFile /dev/null
    AuthName "Please enter your ID and password"
    AuthType Basic
    require valid-user
    order deny,allow

    问题来了 这样写对吗?应该怎样写, 非常感谢!

    本人这方面菜鸟,百度了很多也没搞懂,所以有点麻烦大家了,如果刷了版面不好意思。。。

    5 replies    2015-01-13 08:12:05 +08:00
    aitaii
        1
    aitaii  
    OP
       Jan 12, 2015
    希望不要沉的这么快呀。。。
    解决了之后再沉。。。:(
    ming7435
        2
    ming7435  
       Jan 12, 2015   ❤️ 1
    看到百度估计都不想回lz了
    abelyao
        3
    abelyao  
       Jan 12, 2015
    aitaii
        4
    aitaii  
    OP
       Jan 13, 2015
    @abelyao 感谢!
    aitaii
        5
    aitaii  
    OP
       Jan 13, 2015
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2982 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 14:07 · PVG 22:07 · LAX 07:07 · JFK 10:07
    ♥ Do have faith in what you're doing.