2011-03-10 4 views
5

.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> 

여기에서 should_be_excluded.php를 암호로 보호하지 않도록 제외 할 수 있습니까? 필요하다면 보호 라인을 변경할 수 있지만, 정규식에서 뭔가를 할 수 있다고 생각합니까?

답변

3

방법 같은 것에 대해 :

<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> 

이 제외 된 파일에 대한 모든 액세스 을 허용해야 하는가?

+0

이것은 작동하지 않습니다. 시도해 보셨습니까? 그렇다면 어떤 버전의 아파치를 사용했는지, 문제가 될 수있는 방법은 무엇이라고 생각하십니까? – Centurion

+0

@Centurion'Allow all '아래에'Satisfy all'을 추가하십시오. –