Cen*_*ion 5 php regex apache .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>
Run Code Online (Sandbox Code Playgroud)
如何从这里排除should_be_excluded.php受密码保护?如果需要,我可以更改保护线,但我认为可以在正则表达式中完成某些操作?
怎么样:
<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>
Run Code Online (Sandbox Code Playgroud)
这应该允许所有访问排除的文件?
| 归档时间: |
|
| 查看次数: |
4428 次 |
| 最近记录: |