[英]Exclude one file from password protection in .htaccess
I have the following code to protect files with password in .htaccess
: 我有以下代码来保护
.htaccess
密码文件:
<FilesMatch "\.(html|htm|css|js|php|swf|swz|xml|ico|jpg|jpeg|png|txt)$">
AuthName "Member Only"
AuthType Basic
AuthUserFile /path/to/password/.htpasswd
require valid-user
</FilesMatch>
How can I exclude from here the should_be_excluded.php
from being password protected? 如何从这里排除
should_be_excluded.php
受密码保护? I can change the protection lines if needed, but I think that something could be done in the regex? 如果需要,我可以更改保护线,但我认为可以在正则表达式中完成某些操作?
how about something like: 怎么样的东西:
<FilesMatch "\.(html|htm|css|js|php|swf|swz|xml|ico|jpg|jpeg|png|txt)$">
AuthName "Member Only"
AuthType Basic
AuthUserFile /path/to/password/.htpasswd
require valid-user
</FilesMatch>
<Files /should_be_excluded.php>
Order Allow,Deny
Allow from all
</Files>
this should allow ALL access to the excluded file? 这应该允许ALL访问被排除的文件?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.