如何从子目录中删除 .htaccess 密码保护 [英] How to remove .htaccess password protection from a subdirectory

查看:31
本文介绍了如何从子目录中删除 .htaccess 密码保护的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 .htaccess 密码保护了我的整个网站,但我想公开其中一个子目录,以便无需密码即可查看.

如何禁用子目录的 htaccess 密码保护?具体是什么 .htaccess 语法.

这是我的 .htaccess 文件,它位于我的 ftp 的根目录中.

<前>AuthName "站点管理"AuthUserFile/dir/.htpasswdAuthGroupFile/dev/nullAuthName 安全AuthType 基本需要用户名 1命令允许,拒绝允许所有人

解决方案

您需要在所需目录中创建一个新的 .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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆