Apache 웹서버에서 특정 파일 확장자 접근 차단
페이지 정보
작성자 관리자 (61.♡.26.29) 작성일 17-07-31 18:53 조회 3,537 댓글 0본문
아파치 서버에서 특정 파일의 확장자를 기준으로 접근을 제한할 경우에는,
Files 나 FilesMatch 로 제한을 설정할 수 있다.
httpd.conf 에서 아래와 같은 설정를 추가한다.
[code]
<FilesMatch "\.(sql|inc)$">
deny from all
</FilesMatch>
<Files ~ "^(.*\.sql|.*\.inc)$">
deny from all
</Files>
[/code]
ㅁ Files 와 FilesMatch 의 차이점
FilesMatch 를 권장한다고 한다.
[code]
<FilesMatch "\.(gif|jpe?g|png)$">
[/code]
[code]
<Files ~ "\.(gif|jpe?g|png)$">
[/code]
* 참고
http://pikabu.tistory.com/69
http://www.askapache.com/htaccess/using-filesmatch-and-files-in-htaccess/
https://m.blog.naver.com/m1nk1/120192457657
Files 나 FilesMatch 로 제한을 설정할 수 있다.
httpd.conf 에서 아래와 같은 설정를 추가한다.
[code]
<FilesMatch "\.(sql|inc)$">
deny from all
</FilesMatch>
<Files ~ "^(.*\.sql|.*\.inc)$">
deny from all
</Files>
[/code]
ㅁ Files 와 FilesMatch 의 차이점
FilesMatch 를 권장한다고 한다.
[code]
<FilesMatch "\.(gif|jpe?g|png)$">
[/code]
[code]
<Files ~ "\.(gif|jpe?g|png)$">
[/code]
* 참고
http://pikabu.tistory.com/69
http://www.askapache.com/htaccess/using-filesmatch-and-files-in-htaccess/
https://m.blog.naver.com/m1nk1/120192457657
추천0
댓글목록 0
등록된 댓글이 없습니다.