리눅스 .htaccess 특정 IP 차단: 두 판 사이의 차이

IT위키
(새 문서: 2가지 방법을 이용할 수 있다. === 단순 차단 (403 처리) === <syntaxhighlight lang="bash" line="1"> <RequireAll> Require all granted Require not ip 123.123.123.123 </RequireAll> </syntaxhighlight> === 특정 페이지로 넘기기 === <syntaxhighlight lang="bash" line="1"> RewriteCond %{HTTP:X-FORWARDED-FOR} ^123.123.123.123$ [OR] RewriteCond %{REMOTE_ADDR} ^123.123.123.123$ RewriteRule !blocked.php$ /blocked.php [L,R=301] </syntaxhighlight>)
 
(차이 없음)

2024년 5월 1일 (수) 14:26 기준 최신판

2가지 방법을 이용할 수 있다.

단순 차단 (403 처리)[편집 | 원본 편집]

<RequireAll>
  Require all granted
  Require not ip 123.123.123.123
</RequireAll>

특정 페이지로 넘기기[편집 | 원본 편집]

RewriteCond %{HTTP:X-FORWARDED-FOR} ^123.123.123.123$ [OR]
RewriteCond %{REMOTE_ADDR} ^123.123.123.123$ 
RewriteRule !blocked.php$ /blocked.php [L,R=301]