本文介绍了从子文件夹中删除.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保护
发布评论