V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
aitaii
V2EX  ›  问与答

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

  •  
  •   aitaii · 2015-01-12 18:57:38 +08:00 · 1683 次点击
    这是一个创建于 3405 天前的主题,其中的信息可能已经有所发展或是发生改变。

    请教一个问题(百度出来自己做的不对):访问 /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 条回复    2015-01-13 08:12:05 +08:00
    aitaii
        1
    aitaii  
    OP
       2015-01-12 19:02:58 +08:00
    希望不要沉的这么快呀。。。
    解决了之后再沉。。。:(
    ming7435
        2
    ming7435  
       2015-01-12 19:06:45 +08:00   ❤️ 1
    看到百度估计都不想回lz了
    abelyao
        3
    abelyao  
       2015-01-12 19:09:58 +08:00
    aitaii
        4
    aitaii  
    OP
       2015-01-13 08:11:54 +08:00
    @abelyao 感谢!
    aitaii
        5
    aitaii  
    OP
       2015-01-13 08:12:05 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1022 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:51 · PVG 03:51 · LAX 12:51 · JFK 15:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.