DNS server, DNS service

A.N.C.H.I.H.O.O.N

다른 곳에서 링크한 이미지 허가하지 않기 - Apache의 SetEnvIf 이용하기 본문

웹&컴퓨팅

다른 곳에서 링크한 이미지 허가하지 않기 - Apache의 SetEnvIf 이용하기

chihoon, An. (A.K.A 슈퍼스타) x2chi 2015.07.14 10:58
크리에이티브 커먼즈 라이선스
Creative Commons License

레퍼럴이 www.example.com 아닌 사이트에서  /web/images 디렉토리에 접근하는 것을 막는 것입니다.

Prevent "Image Theft"

This example shows how to keep people not on your server from using images on your server as inline-images on their pages. This is not a recommended configuration, but it can work in limited circumstances. We assume that all your images are in a directory called /web/images.

    SetEnvIf Referer "^http://www.example.com/" local_referal
    # Allow browsers that do not send Referer info
    SetEnvIf Referer "^$" local_referal
    <Directory /web/images>
      Order Deny,Allow
      Deny from all
      Allow from env=local_referal
    </Directory>


출처 : http://httpd.apache.org/docs/1.3/mod/mod_setenvif.html#setenvif

 

http://httpd.apache.org/docs/1.3/mod/directive-dict.html#Context

SetEnvIf 에서 사용할 수 있는것은 아래와 같습니다.
Remote_Host - the hostname (if available) of the client making the request
Remote_Addr - the IP address of the client making the request
Request_Method - the name of the method being used (GET, POST, et cetera)
Request_Protocol - the name and version of the protocol with which the request was made (e.g., "HTTP/0.9", "HTTP/1.1", etc.)
Request_URI - the portion of the URL following the scheme and host portion

 

 

 

http://httpd.apache.org/docs/1.3/env.html

 

 

출처 : http://dani.egloos.com/1682729 

신고
0 Comments
댓글쓰기 폼