(1)현황:
 
며칠 전부터 특정 IP들이 장시간 개인홈페이지를 access하고 있으며 일일 traffic양을 일찍 소진시켜 홈페이지가 뜨지 않는 현상 발생.
웹호스팅 업체가 제공하는 traffic 점유중인 IP들을 보여주는 tool (http://ibooklove.dothome.co.kr/traffic) 을 사용하여 며칠간 문제의 ip들을 색출해냄.

문제의 ip들은 54.36.150.86,   54.36.150.67,  54.36.148.55,  54.36.148.108, 54.36.149.32,  등등. 

문제의 ip들은 프랑스에 있는 것임을 알게 됨(https://www.abuseipdb.com/check/54.36.150.86 혹은 https://www.abuseipdb.com/ 들어간 후 문제의 ip를 check ip라는 검색박스에 입력. 
또는 https://www.ip2location.com/demo 들어간 후 문제의 ip를 LOOKUP 검색박스에 입력.)

프랑스에서 여러 개의 ip들로 장시간 개인홈페이지의 traffic을  점유하는 것은 정상적이 아니므로 막기로 결정함.

(2)해결:

.htaccess 파일에 비정상적인 traffic을 발생시키는 ip 혹은 사이트 주소(제로보드의 "관리"  tool을 사용하여 "리퍼러통계"를 사용하니 비정상적으로 특정 사이트,즉 http://twks.dothome.co.kr 으로부터 개인홈페이지 접근이 많음이 발견. )를 등록하면 된다.
deny from 54.36.148
deny from 54.36.150 으로 등록하였다가 54.36.149도 발견되어 아예 프랑스로부터 들어오는 걸 모두 막기 위해 deny from 54.36 로 수정하였다.


.htaccess 파일은 숨겨진 파일이므로 (알)FTP의 옵션 메뉴/환경설정/일반/"숨겨진 파일 보여줌"에 check표시후 확인 클릭해야 모습을 드러낸다.
.htaccess 파일이 있는 위치는 홈페이지의 index.html이 있는 폴더에 있다. 
(remote server 창의)" .htaccess" 파일에 커서를 위치하고 마우스 우측을 누르면 나타나는 메뉴창 내의 "수정(J)" 를 클릭. 
아래(1)의 (1)처럼 메모장(notepad)이 나타나면 아래(1)의 (2)처럼 문제의 ip와 문제의 사이트 주소를 추가등록후 file/save. 
고로 (알)FTP의 창이 뜨는데 ".htaccess 파일을 전송하시겠습니까?"에 대해 "예" 클릭. 고로 해결됨.

그런데 " .htaccess" 파일을 여는 프로그램은 기본적으로 연결되어 있는 메모장(notepad) 보다는, textpad를 본인은 잘 사용하고 있기 때문에 textpad에 연결하였다. 
 메모장(notepad)가 아니라,  아래의 내용으로  textpad로 보여지는 것이 수정하기도 더 편하기 때문. 
 .htaccess 파일을 클릭하면 textpad가 뜨도록 하려면 다음과 같이 설정해주면 된다.
 즉 (알)FTP의 옵션 메뉴/환경설정/고급/수정시 연결할 프로그램 내에서 "확장자"는 ".htaccess" 를 입력하고, "연결 프로그램"에는 폴더를 찾아가는 아이콘을 클릭하여 "textpad.exe"를 찾아내어 선택한 후, "추가"버튼 클릭하면 된다.
 
(3)참조:

.htaccess 파일은 특정 폴더(및 그 하부의 폴더들까지 모두)에 접근을 제한하는 기능을 한다. 특정 홈페이지에 대한 접근을 제한하는 것이 아니라, .htaccess 파일이 위치하고 있는 폴더(디렉토리)와 그 하부 폴더(sub-directory)전체에 대한 특정 ip및 특정 홈페이지으로부터의 접근을 제한하는 것이다.  그리고 .htpasswd 파일을 이용하면, id와 password를 설정 가능하다.

.htaccess 는 서버에서 지원을 해야 사용이 가능한데 cafe24, dothome은 지원한다. 지원하지 않는 데도 많다고 하니 지원여부는  호스팅 업체에게 문의해보시기를.

 


-아래(1)-

(1).htaccess 파일 (수정 전)

SetEnvIfNoCase remote_addr 66.249.77.61 go_out
SetEnvIfNoCase remote_addr 66.249.73.* go_out 
SetEnvIfNoCase remote_addr 66.249.74.62 go_out 
SetEnvIfNoCase remote_addr 66.249.77.180 go_out
SetEnvIfNoCase remote_addr 61.247.204.36 go_out 
SetEnvIfNoCase remote_addr 61.247.204.37 go_out 
SetEnvIfNoCase remote_addr 61.247.204.38 go_out 
SetEnvIfNoCase remote_addr 61.247.204.39 go_out 
SetEnvIfNoCase remote_addr 66.249.72.170 go_out 
SetEnvIfNoCase remote_addr 27.101.192.205 go_out 
SetEnvIfNoCase remote_addr 66.249.72.170 go_out 
SetEnvIfNoCase remote_addr 66.249.72. go_out 
SetEnvIfNoCase remote_addr 66.249.77. go_out 
SetEnvIfNoCase remote_addr 66.249.74. go_out 
SetEnvIfNoCase remote_addr 61.247.204. go_out 
SetEnvIfNoCase remote_addr 27.101.192.241 go_out 
SetEnvIfNoCase remote_addr 180.76.5.196 go_out 
SetEnvIfNoCase remote_addr 180.76.5.* go_out 
SetEnvIfNoCase remote_addr 180.76.6.* go_out 
SetEnvIfNoCase remote_addr 27.101.192.208 go_out 
SetEnvIfNoCase remote_addr 27.101.192.* go_out 
Order Allow,Deny 
Allow from all 
Deny from env=go_out 

(66.249.77.61, 66.249.73.* 등등을 막느라 오래전에 " .htaccess" 파일을 만들어 그 속에 coding해 넣은 내용이다.)


(2).htaccess 파일 (수정 후)

SetEnvIfNoCase remote_addr 66.249.77.61 go_out
SetEnvIfNoCase remote_addr 66.249.73.* go_out 
SetEnvIfNoCase remote_addr 66.249.74.62 go_out 
SetEnvIfNoCase remote_addr 66.249.77.180 go_out
SetEnvIfNoCase remote_addr 61.247.204.36 go_out 
SetEnvIfNoCase remote_addr 61.247.204.37 go_out 
SetEnvIfNoCase remote_addr 61.247.204.38 go_out 
SetEnvIfNoCase remote_addr 61.247.204.39 go_out 
SetEnvIfNoCase remote_addr 66.249.72.170 go_out 
SetEnvIfNoCase remote_addr 27.101.192.205 go_out 
SetEnvIfNoCase remote_addr 66.249.72.170 go_out 
SetEnvIfNoCase remote_addr 66.249.72. go_out 
SetEnvIfNoCase remote_addr 66.249.77. go_out 
SetEnvIfNoCase remote_addr 66.249.74. go_out 
SetEnvIfNoCase remote_addr 61.247.204. go_out 
SetEnvIfNoCase remote_addr 27.101.192.241 go_out 
SetEnvIfNoCase remote_addr 180.76.5.196 go_out 
SetEnvIfNoCase remote_addr 180.76.5.* go_out 
SetEnvIfNoCase remote_addr 180.76.6.* go_out 
SetEnvIfNoCase remote_addr 27.101.192.208 go_out 
SetEnvIfNoCase remote_addr 27.101.192.* go_out 
<Files *>
Order Allow,Deny 
Allow from all 
deny from 54.36.148
deny from 54.36.150
deny from 54.36
deny from .*example\.com.*
deny from .*twks\.dothome.co.kr.*
Deny from env=go_out 
</Files>


-아래(2)- (참조 자료)

(1)

특정 ip 2가지가 비정상적으로 장시간 점유하여 Traffic을 고갈시키는데, ip 못들어오게 막는 방법은?                   
          
구분 : 웹호스팅
며칠전부터 "트래픽 80%가 초과되었습니다"라는 문자메시지가 날라옵니다.

traffic이 초과될 정도는 아닌 개인홈페이지인데, 이상하여  닷홈이 제공하는 traffic 모니터링(http://ibooklove.dothome.co.kr/traffic) 기능을 사용하여 며칠간 보았더니 아래 2가지의 ip가 장시간 홈페이지를 점유하고 있었고, 그 ip의 소재지는 프랑스이더군요.
프랑스에서 개인 홈페이지를 장시간 점유하고 있는 것은 비정상적인 것이라서 아래 2가지 ip를 못 들어오게 막고 싶은데 어떻게 하면 되는지요?  

zeroboard 게시판의 스팸ip 등록 기능을 사용해도 막지를 못하더라구요.

-아래-

54.36.150.*
54.36.148.*

덧글 1개



관리자                                               

안녕하세요. 고객지원 담당 김OO입니다.

차단하고 싶은 IP가 있을 경우 ibooklove 계정에 FTP 접속 후 html 폴더안에 있는 .htaccess 파일로 차단이 가능합니다.

.htaccess 설정의 경우 자세히 안내 드리기는 어려운 점 양해 부탁 드립니다.

아래 링크를 참고하여 .htaccess 파일로 IP 차단 설정이 가능합니다.

https://www.thewordcracker.com/miscellaneous/block-ip-addresses-or-domains-with-htaccess/


감사합니다. 좋은 하루 되세요.


(2)

htaccess를 사용하여 특정 IP 주소 또는 특정 도메인 차단하기

불량 사용자나 스패머, 사이트 글을 복제하는 사용자 혹은 특정 웹사이트에서 불필요하게 사이트로 유입되는 경우 .htaccess를 통해 IP나 유입 사이트 주소로 차단할 수 있습니다.

FTP 클라이언트를 사용하여 FTP에 접속한 후에 .htaccess 파일을 열고 아래와 같이 편집하도록 합니다.  .htaccess 파일이 없는 경우 루트에 하나를 만들도록 합니다. (FTP 사용법은 이 글을 참고해보시기 바랍니다.)

특정 IP 주소/도메인 차단하기

다음 형식을 사용하면 192.168.1.25, 192.168.1.26, example.com을 제외한 모든 IP 및 도메인이 허용됩니다. (즉, 별도로 지정된 IP 주소나 사이만 차단됨).

# allow all except those indicated here
<Files *>
order allow,deny
allow from all
deny from 192.168.1.25
deny from 192.168.1.26
deny from .*example\.com.*
</Files>

특정 IP 주소/도메인만 허용하기

다음 스크립트를  .htaccess에 입력하여 지정된 IP와 도메인을 제외한 모든 IP와 도메인을 차단할 수 있습니다.

# Deny access to everyone, except those listed here:
<Files *>
order deny,allow
deny from all
deny from 192.168.1.21
deny from 192.168.1.22
allow from .*example\.com.*
</Files>

특정 참조 도메인으로부터 유입되는 방문자 차단하기

참조 도메인(Referring domain)별로 원치 않는 방문자를 차단하려면 아래와 같은 스크립트를 사용합니다. (domain1domain2를 차단할 참조 도메인으로 대체하도록 합니다.)

# block visitors referred from indicated domains
RewriteEngine on
RewriteCond %{HTTP_REFERER} domain01\.com [NC,OR]
RewriteCond %{HTTP_REFERER} domain02\.com [NC]
RewriteRule .* - [F]
# Source: mediatemple.net

워드프레스 스팸 IP 차단

Block spams in WordPresshttps://www.thewordcracker.com/wp-content/uploads/2016/02/Block-spams-in-WordPress-300x98.jpg 300w" sizes="(max-width: 719px) 100vw, 719px">

워드프레스에서 스팸 때문에 고민하는 경우 Akismet이나 IP Blacklist Cloud 등의 플러그인을 사용할 수 있습니다. 스팸 차단 플러그인에 대한 내용은 여기를 참고해보시기 바랍니다.

참고:



(3)


질문
.htaccess 의 사용방법

카페24 에서 호스팅을 받아서 사용중인데요. 외부링크를 차단하기 위해서 .htaccess 라는 파일을 만들어서

사용중인데요. 일단 그 리눅스 명령어를 보면은...

 

PHP_FLAG register_globals ON

SetEnvIFNoCase Referer "저의도메인" pass

SetEnvIFNoCase Referer "naver.com" pass

SetEnvIFNoCase Referer "daum.net" pass

SetEnvIFNoCase Referer "^$" pass

 

Order deny,

allow deny from all

allow from env=pass

 

이런식입니다.

 

이렇게 하면 저의 도메인과 네이버 그리고 다음에서 들어오는 경로는 통과가 되고

나머지는 전부 막히잖아요?

 

헌데 제가 하고 싶은 것은 모든 곳에서 직접 주소를 치고 들어오든, 링크를 통해 들어오든

들어오는것은 모두 허용하는데 반해서 제 홈페이지에 있는 내용의 이미지나 동영상의 무단링크를 막고 싶어요.

 

그런데 위의 소스대로 적용을 했더니, 제 홈페이지의 이미지나 동영상은 무단링크가 방지가 되는데요.

저기에 네이버와 다음을 제외하고는 다른곳에서 링크를 통해서는 들어올 수가 없어요.

모든 사이트들을 저곳에 추가해줄 수는 없잖아요?

한마디로 네이트온 사이트에 제 사이트 링크주소를 걸어놨을 경우에 그것을 클릭하면

에러페이지가 나옵니다. 접근이 안된다는거죠.

 

모든 곳에서 직접 주소를 치든, 링크를 클릭해서 들어오든 접근은 모두 허용을 하는데

제 홈의 이미지나 동영상, 플래시 등의 파일을 링크하는 것을 막는 .htaccess 사용 방법좀 알려주세요~

내 프로필 이미지
  • 질문수143
  • 채택률84.7%
  • 마감률89.3%
                       
작성일2008.07.22 조회수 6,657 
  

답변1

munh**** 님 답변

고수채택답변수 272C, C++, 윈도우, 자바스크립트
질문자채택
    
SetEnvIfNoCase Referer "^http://www.mydomain.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://www.mydomain.com$" locally_linked=1
SetEnvIfNoCase Referer "^http://mydomain.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://mydomain.com$" locally_linked=1
#SetEnvIfNoCase Referer "^$" locally_linked=1
<FilesMatch ".(gif|png|mp3|bmp|jpg|jpeg)$">
  Order Allow,Deny
  Allow from env=locally_linked
</FilesMatch>

이렇게 하면 루트 이하 모든 폴더에 있는 .gif, .png, .bmp, .jpg, .jpeg, .mp3 파일에 대해 자신의 계정 (mydomain.com) 외에서 보내는 요청이 거부됩니다. 커멘트 처리한 다섯번째 줄은 웹사이트가 아닌 하드 드라이브에서 파일을 요청할 경우에는 허용하라는 얘기 같은데, 별 필요를 못 느껴서 커멘트했지만 필요하다고 생각하시면 샵 표시를 지우시면 됩니다.

(4)


질문
제로보드XE 설치가 안되요ㅠㅠ

불루웹에서 제로보드 전용 호스팅을 신청했습니다.

제로보드xe전용이라 첨부터 설치된채로 호스팅을 해주는데

관리자 모드로 들어갔더니 아예 안되는거에요.

 

그래서 제가 직접 다시 설치할려구

제로보드 메뉴얼대로 압축풀고 FTP를 이용해 zbxe째 통째로 올렸거든요 

퍼미션도 777로 바꿨고

그다음 "도메인.com/zbxe"로 설치하기 위해 들어갔는데 아무것도 안뜹니다. 

오류페이지 조차 안뜨고 텅비었어요 

 

이율 모르겠어요

 

그리고 제로보드 zbxe 폴더 안에 하의 폴더말고 파일이 3개 있고 그중에" .htaccess "란 파일이 있잖아요

윈도우에 압축풀었을때는 있는데

 

그파일은 FTP로 올렸때 업로드 실패한것도 아닌데

FTP에 아예 나타나질 않더군요.

제로보드 설치 메뉴얼 캡쳐사진엔 그파일도 온전히 업로드되어있는데

이상하게 제가 쓰는 FTP에선 업로드가 안되요

설마 FTP에 문제가 있는건가요? 다른 FTP프로그램을 쓰면 해결되는건지?

 

그래서 파일 이름을 xx.htaccess 란 식으로 수정해서 업로드했더니 그때는 뜨더군요

근데 다시 원래 파일이름인 .htaccess로 수정하면 FTP에서 사라져요ㅡㅡ;

 

어떻게 해야 하죠?

 

 

제발 방법 알려주세요ㅠㅠ

                         작성일2008.02.12 조회수 3,161
          
초수채택답변수 27
질문자채택

오류페이지조차 안뜨고 텅 비어 있다면 도메인.com/zbxe 디렉토리의 index 파일이 빈 파일이고 그것이 불려진 것일겁니다.

 

좀더 확실히 확인해보려면 소스보기를 한번 해보세요. 아무것도 없다면 index 파일이 빈 파일일것입니다.

 

그리고 .htaccess 처럼 .으로 시작하는 파일명은 리눅스/유닉스 계열에선 히든파일로 인식됩니다. ftp에서 히든파일까지 보여지게 하려면 ftp 프로그램의 옵션에서 히든파일보기를 체크하시면 됩니다.


(5)

문하우스
2008.10.10 12:13

문하우스의 .htaccess 내용입니다.

    
 
Extra Form
원작자80san
적용여부적용

문하우스의 Zbxe의 설치경로는 www/zbxe/ 입니다.

1. http://www.moonhouse.co.kr의 2차도메인으로 접속을 해도 http://jcas.co.k 1차도메인으로 주소창에 보이게끔 설정되어 있습니다.( https://moonhouse.co.kr/zbxe/xetip/222238 참조 )

2. https://moonhouse.co.kr/zbxe로 접속을 해야합니다. 불편하죠 그래서 http://moonhouse.co.kr로 접속을 해도 되겠금 하는 설정을 사용중입니다.
( http://www.zeroboard.com/16660730 참조 )

3. 특정IP(외국의 검색사이트 같음)의 활동으로 트래픽이 너무 많이 발생하므로 트래픽을 많이 발생기키는 IP원천 차단을 사용중입니다. ( http://www.zeroboard.com/16724165 참조 )

[위의 3가지 설정을 하는 방법]

먼저 루트폴더에 .htaccess를 만들어서 아래의 스크립트를 작성해야 합니다.
zbxe폴더에 있는 .htaccess과 절대 아닙니다.(만약 이파일을 편집하면 홈페이지가 작동을 중단합니다.)

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.jcas\.co\.kr)(:80)? [NC]
RewriteRule ^(.*)
https://moonhouse.co.kr/$1 [R=301,L]

RewriteBase /
RewriteCond %{ENV:REDIRECT_SURI} ^$ [OR]
RewriteCond %{ENV:REDIRECT_SURI} ^/$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /zbxe/$1 [R]
RewriteRule ^/$ /zbxe/?mid=home [L]
RewriteRule ^$ /zbxe/?mid=home [L]

SetEnvIfNoCase remote_addr 93.174.93 go_out
SetEnvIfNoCase remote_addr 92.48.84 go_out
SetEnvIfNoCase remote_addr 77.91 go_out
SetEnvIfNoCase remote_addr 211.252 go_out
SetEnvIfNoCase remote_addr 222.122.194.76 go_out
SetEnvIfNoCase remote_addr 211.245.21 go_out
SetEnvIfNoCase remote_addr 192.68 go_out
SetEnvIfNoCase remote_addr 121.200 go_out
SetEnvIfNoCase remote_addr 78.110 go_out
SetEnvIfNoCase remote_addr 211.51 go_out
SetEnvIfNoCase remote_addr 78.46 go_out
SetEnvIfNoCase remote_addr 161.222 go_out
SetEnvIfNoCase remote_addr 57.68 go_out
SetEnvIfNoCase remote_addr 167.206 go_out
SetEnvIfNoCase remote_addr 217 go_out
SetEnvIfNoCase remote_addr 216 go_out
SetEnvIfNoCase remote_addr 213 go_out
SetEnvIfNoCase remote_addr 212 go_out
SetEnvIfNoCase remote_addr 209 go_out
SetEnvIfNoCase remote_addr 94.102 go_out
SetEnvIfNoCase remote_addr 158.64 go_out
Order Allow,Deny
Allow from all
Deny from env=go_out

1번 빨간색부분의 설정입니다.
https://moonhouse.co.kr/zbxe/xetip/222238 참조

2번 파란색부분의 설정입니다.
RewriteBase /
RewriteCond %{ENV:REDIRECT_SURI} ^$ [OR]
RewriteCond %{ENV:REDIRECT_SURI} ^/$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /zbxe/$1 [R]
RewriteRule ^/$ /zbxe/?mid=home [L]
RewriteRule ^$ /zbxe/?mid=home [L]

굵게 표시된 3곳을 자신의 설정에 맞게끔 편집하세요.

3번 부분의 설정은 차단할 IP를 적어 넣어시면 됩니다.
123.456.789.111 이렇게 모두 적어주시면 하나의 IP만 차단되고,
123 이렇게 첫 숫자만 적어주면 123으로 시작하는 모든 IP를 차단합니다.
제가 IP를 차단하면서 살펴보니 앞의 숫자3개가 보통 국가를 지정하더군요
그래서 유럽에서 오는 IP들은 원천차단 했습니다.
이것들은 robots.txt(https://moonhouse.co.kr/zbxe/xetip/152788/)의 규정을 거의 지키지 않더군요. 

참고로 제가 사용하는 .htaccess 파일 올립니다.


(6)

Creating an .htaccess file on your DreamHost web server

View the following article for instructions on how to create an .htaccess file on your web server:

If the file already exists, view the following articles for instructions on how to update it (depending on if you're using an FTP client or SSH):

Once the file has been created, you can add the code examples below to it. 

Deny access to files

Denying access to specific file extensions

The following code forces any file ending in .inc to throw a 404 Forbidden error when visited:

<Files ~ "\.inc$">  
Order Allow,Deny
Deny from All
</Files>

Denying access to "hidden" files

File names beginning with a dot are considered "hidden" by UNIX. Usually, you don't want to serve them to visitors.

DreamHost already disallows retrieving '.htaccess' and '.htpasswd', but you can recursively deny all access to all hidden files by placing the following into a top-level .htaccess:

RedirectMatch 403 /\..*$

Deny access to folders

Denying access to a directory listing

If you don't have an index file in your directory, all of your files are listed in a directory list for anyone to view. The following code forces this directory listing to throw a 404 Forbidden error instead when visited:

Options -Indexes

Denying access during a specific hour of the day

If you wish to block access to files in a directory during a specific time of day, then you can do so by adding the following code to an .htaccess file:

RewriteEngine On
# If the hour is 16 (4 PM)
RewriteCond %{TIME_HOUR} ^16$
# Then deny all access
RewriteRule ^.*$ - [F,L]

If someone visits the directory anytime between 4:00 – 4:59 pm, a 500 Internal Server error is thrown. You can also specify multiple hours as well:

RewriteEngine On
# Multiple hour blocks
# If the hour is 4 PM or 5 PM or 8 AM
RewriteCond %{TIME_HOUR} ^16|17|08$
# Then deny all access
RewriteRule ^.*$ - [F,L]

Denying access to a directory

If you have a directory named 'blah' that you want to block, but it can occur anywhere in your directory tree, use the following:

RewriteEngine On
RewriteRule (^|/)blah(/|$) - [F]

Denying access from specific IP addresses

If you have problems with certain visitors to your website, you can easily ban them. There are two different ways to ban visitors:

  • using their IP address, or
  • the domain name from which they are visiting.

Here's an example that denies a user by their IP address:

deny from 173.236.241.100

When the user tries to connect to your site from that specific IP, they see a 403 Forbidden page instead. If you want to block an entire block of IPs, just leave the last octet off. For example:

deny from 173.236.241.

This denies access from anyone using an IP in the range from 173.236.241.0 all the way up to 173.236.241.255.

The following link is a useful online tool that automatically generates an IP range for you:

Allowing access from a specific IP

If you need to deny access to your site to everyone while still allowing yourself or another specific IP address to visit it, you can use something like this:

order deny,allow
deny from all
allow from <YOUR_IP_ADDRESS>

Denying access from a specific domain

This denies access from anyone connecting to your site from www.example.com. If someone clicks on a link at example.com that redirects to your site, they then see a 403 Forbidden error:

SetEnvIfNoCase Referer "example.com" bad_referer
Order Allow,Deny
Allow from ALL
Deny from env=bad_referer

This example throws a 500 Internal Server Error for anyone linking from example.com:

RewriteEngine on
RewriteCond %{HTTP_REFERER} example\.com [NC,OR]
RewriteRule .* - [F]

The following example redirects any visitor connecting from example.com to google.com:

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://example.com/
RewriteRule /* http://www.google.com [R,L]

See also

How do I deny access to my site with an .htaccess file?


이 게시물을..