小编dim*_*vic的帖子

我可以使用 htaccess 密码保护 apache 中的位置(不是目录)吗?

我在 apache 配置中使用了这样的代码来保护带有密码的位置

<Location ~ "/admin.*">
    AuthType Basic
    AuthName "Protected Area"
    AuthUserFile /home/user/public_html/.htpasswd
    Require valid-user
</Location>
Run Code Online (Sandbox Code Playgroud)

有没有办法使用 htaccess 文件做同样的事情?

我想保护的位置在文件系统上并不真正存在,由于 mod_rewrite,它的位置可用

authentication .htaccess htpasswd apache-2.2

7
推荐指数
1
解决办法
4741
查看次数

标签 统计

.htaccess ×1

apache-2.2 ×1

authentication ×1

htpasswd ×1