허용된 호스트로만 접근 가능하도록 Apache 웹 서버의 .htaccess 설정

안녕하세요, 하마연구소 입니다.

allow1.yourdomain.comallow2.yourdomain.com으로만 아파치 웹서버로 접근가능하도록 .htaccess의 rewrite engine을 설정하는 방법입니다.
allow3.yourdomain.com으로 접근하면 forbidden(403) 오류가 발생합니다.

RewriteEngine On

RewriteCond %{HTTP_HOST} !^allow1.yourdomain.com$
RewriteCond %{HTTP_HOST} !^allow2.yourdomain.com$
RewriteRule .* - [F,L]

감사합니다.

Leave a Reply

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다