从子文件夹中删除.htpasswd保护

编程入门 行业动态 更新时间:2024-10-21 20:29:59
本文介绍了从子文件夹中删除.htpasswd保护的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经使用.htpasswd保护了我的根文件夹

I have protected my root folder using .htpasswd

AuthType Basic AuthName "Restricted Access" AuthUserFile /home/a1199104/public_html/.htpasswd Require user lamak

上面的代码拒绝访问我的整个站点/文件夹/子文件夹,我有一个子文件夹 public .它有一些公共文件.我希望任何人都可以访问此文件夹和没有密码保护的文件,这是可能.?

The above code deny access to my whole site/folder/subfolder, I have a subfolder public It has some public files .I want anyone to access this folder and files without password protection, is this possible.?

推荐答案

您可以使用SetEnv和Order指令删除密码保护:

You can use SetEnv and Order directive to remove password protection :

尝试:

#set env variable noauth if uri is "/public/files" SetEnvIf Request_URI ^/public/ noauth=1 #auth AuthType Basic AuthName "Restricted Access" AuthUserFile /home/a1199104/public_html/.htpasswd Require user lamak #Here is where we allow/deny Order Deny,Allow Satisfy any Deny from all Require user lamak Allow from env=noauth

更多推荐

从子文件夹中删除.htpasswd保护

本文发布于:2023-11-09 21:08:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573440.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   从子   夹中   htpasswd

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!