1. Assume that the host domain of the allowed linkage is: www.demo.com.cn
2. Modify httpd.conf
SetENVIFNOCASE REFERER "^ http://www.demo.com.cn/" Local_ref = 1
ORDER ALOW, DENY
Allow from env = local_ref
Filesmatch>
This simple application is not to solve the problem of pictorial chains, and a slightly modification can also prevent any file to steal the problem.
When using the above method When connecting a picture from an unspecified host, the picture will not be displayed. If you want to display a "prohibited chain" picture, we can use MOD_REWRITE to be implemented.
First, add the MOD_REWRITE module when installing Apache.
Suppose the picture of the "prohibited chain" is abc.gif, we can configure this in httpd.conf:
ReWriteEngine on
Rewritecond% {http_referer}! ^ $
ReWritecond% {http_refere}! ^ Http: // (www /.)? Demo.com.cn / (()
Rewriterule /.(gif|jpg) $ http://www.demo.com.cn/abc.gif [r, l]
When the image of the host is stealing, you will only see the picture of ABC.GIF "forbidden chain"!