Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

.htaccess 파일을 이용해 특정 IP 접근 차단하기

요즘 댓글, 트랙백 등의 서비스 때문에 서버의 트래픽이 날로 증가하고 있다.

이럴때 맘에 안드는 스팸 IP를 차단하는 방법이 있다.

웹서버의 루트폴더에 .htaccess 파일을 생성한다.

생성된 파일에 아래와 같이 설정하도록 한다.

SetEnvIfNoCase remote_addr 94.229.65.* go_out Order allow,deny Allow from all Deny from env=go_out

이렇게 하게 되면 94.229.65.* 에 해당하는 아이피가 접근을 시도하게 될 경우 거부하도록 설정할 수 있다.

Leave a Reply

Your email address will not be published. Required fields are marked *