There are currently 3 posts.
Font size: Small - 100% (Default)  Content converter: No conversion
 
Clicks Replies
1904 2
【Apache】通过.htaccess文件去掉单独一个文件的密码访问(HTTP Authentication 401)
巨大八爪鱼
武林盟主 二十一级
Reply
Floor 1 Posted at: 8/7/14 19:04
比如整个网站已经设置了访问密码,但现在我需要解锁一个特殊的文件,要求不需要任何用户名和密码就能访问这个文件,而访问其他文件仍然需要输入用户名和密码。假设这个文件是ajax/upload.php,可以在ajax目录下再建立一个.htaccess,写上:
<Files "upload.php">
Satisfy Any
</Files>
注意引号内绝对不能出现斜杠“/”,也就是说不能指定子目录的文件,只能指定.htaccess文件所在目录的文件。

然后重启ie浏览器,访问http://localhost/,需要密码
而访问http://localhost/upload.php,则不需要密码
巨大八爪鱼
武林盟主 二十一级
Reply
Floor 2 Posted at: 8/7/14 19:08
有一个错误,改一下:
然后重启ie浏览器,访问http://localhost/,需要密码
而访问http://localhost/ajax/upload.php,则不需要密码
巨大八爪鱼
武林盟主 二十一级
Reply
Floor 3 Posted at: 8/7/14 19:18
参考文献:http://tareqalam.com/2012/03/27/swfupload-error-401/
Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.
(Shortcut key: Ctrl+Enter)
Post Information
Clicks: 1904 Replies: 2
Author: 巨大八爪鱼
Last reply: 巨大八爪鱼
Last reply time: 8/7/14 19:18
Good area: 网页编程
Bar Good Posts
Announcements