代码之家  ›  专栏  ›  技术社区  ›  rabidmachine9

.htpasswd输入代码点火器

  •  3
  • rabidmachine9  · 技术社区  · 15 年前

    你好,我想密码保护我的一个控制器在codeigniter。这是.htaccess中的代码

    # password-protect single file
    <Files my_controller.php>
    AuthName "my_controller.php"
    AuthType Basic
    AuthUserFile /home2/afolder/.htpasswds/.htpasswd
    require valid-user
    </Files>
    

    /my_controller/ (no.php)所以保护没有效果…我能做些什么来克服这个问题吗?

    1 回复  |  直到 15 年前
        1
  •  9
  •   rabidmachine9    15 年前

    最后解决办法就这么简单。。。

    # password-protect single file
    <Files my_controller>
    AuthName "my_controller"
    AuthType Basic
    AuthUserFile /home2/afolder/.htpasswds/.htpasswd
    require valid-user
    </Files>
    

    刚刚删除了php,一切都很好。。。

    推荐文章