如何从子目录中删除 .htaccess 密码保护 [英] How to remove .htaccess password protection from a subdirectory
问题描述
我使用 .htaccess
密码保护了我的整个网站,但我想公开其中一个子目录,以便无需密码即可查看.
如何禁用子目录的 htaccess 密码保护?具体是什么 .htaccess
语法.
这是我的 .htaccess
文件,它位于我的 ftp 的根目录中.
您需要在所需目录中创建一个新的 .htaccess
文件并包含 Satisfy any
指令像这样,直到 Apache 2.3:
# 允许任何用户看到这个目录满足任何
Apache 2.4 中的语法发生了变化,这具有相同的效果:
要求所有授予
I have password protected my entire website using .htaccess
but I would like to expose one of the sub directories so that it can be viewed without a password.
How can I disable htaccess password protection for a sub directory? Specifically what is the .htaccess
syntax.
Here is my .htaccess
file that is placed in the root of my ftp.
AuthName "Site Administratrion" AuthUserFile /dir/.htpasswd AuthGroupFile /dev/null AuthName secure AuthType Basic require user username1 order allow,deny allow from all
You need to create a new .htaccess
file in the required directory and include the Satisfy any
directive in it like so, for up to Apache 2.3:
# allows any user to see this directory
Satisfy Any
The syntax changed in Apache 2.4, this has the same effect:
Require all granted
这篇关于如何从子目录中删除 .htaccess 密码保护的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!