httpd.conf SetEnvIf의 Cookie를 이용한 접속 제어
작성자 정보
- 유영훈 작성
- 작성일
컨텐츠 정보
- 2,148 조회
- 0 추천
- 목록
본문
안녕하세요.
Apache Version : 2.0.56
SetEnvIf 의 Cookie 값을 이용해서 접속 제어를 하려 합니다
아래와 같이 설정을 하면 쿠키값이 "ID=02" 인 접속자들은 "/test_web/" 페이지로 정상 접속합니다. 여기까지는 아시는 사항 이죠?
SetEnvIf Cookie ID=02 link_allow
<DirectoryMatch "/test_web/">
Order Deny,Allow
Allow from env=link_allow
Deny from all
ErrorDocument 401 /error.html
ErrorDocument 402 /error.html
ErrorDocument 403 /error.html
</DirectoryMatch>
문제는 쿠키값을 하나가 아닌 두개로 비교를 해서 "AND" 조건으로 제어를 하고 싶습니다
예를 들면 쿠키값이 "ID=02" 이고 "NUM=01" 일때만 "/test_web/" 페이지 접속을 허용하고 싶습니다
테스트 해보니 아래와 같이 "OR"는 "|"와 "(,)"를 쓰면 됩니다
SetEnvIf Cookie (ID=02|NUM=01) link_allow
<DirectoryMatch "/test_web/">
Order Deny,Allow
Allow from env=link_allow
Deny from all
ErrorDocument 401 /error.html
ErrorDocument 402 /error.html
ErrorDocument 403 /error.html
</DirectoryMatch>
그러나 AND는 되지 않는 군요.
"AND" 조건을 쓰고 싶은데 방법을 알려 주십시요. 혹은 아파치에서 지원을 하지 않나요?
많은 댓글 부탁드립니다
감사합니다
관련자료
-
이전
-
다음